mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <groeck@chromium.org>
To: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Chandra Sekhar Anagani <chandra.sekhar.anagani@intel.com>,
	Bruce Ashfield <bruce.ashfield@windriver.com>,
	Bin Gao <bin.gao@intel.com>,
	Pranav Tipnis <pranav.tipnis@intel.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	Guenter Roeck <groeck@chromium.org>
Subject: [RFC PATCH v2 1/4] usb: typec: Do not check if connected when setting roles
Date: Wed, 17 Aug 2016 15:04:33 -0700	[thread overview]
Message-ID: <1471471476-53251-2-git-send-email-groeck@chromium.org> (raw)
In-Reply-To: <1471471476-53251-1-git-send-email-groeck@chromium.org>

The connection status can change after the connection status was
checked. Leave it up to the driver to perform the necessary checks.

Signed-off-by: Guenter Roeck <groeck@chromium.org>
---
v2: Rebased to v5 of Type-C class code

 drivers/usb/typec/typec.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
index 52a0431253a8..fa0261dad3b7 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -785,9 +785,6 @@ current_data_role_store(struct device *dev, struct device_attribute *attr,
 		return -EOPNOTSUPP;
 	}
 
-	if (!port->connected)
-		return size;
-
 	ret = sysfs_strmatch(typec_data_roles, ARRAY_SIZE(typec_data_roles),
 			     buf);
 	if (ret < 0)
@@ -851,9 +848,6 @@ static ssize_t current_power_role_store(struct device *dev,
 		return -EIO;
 	}
 
-	if (!port->connected)
-		return size;
-
 	ret = sysfs_strmatch(typec_roles, ARRAY_SIZE(typec_roles), buf);
 	if (ret < 0)
 		return ret;
-- 
2.8.0.rc3.226.g39d4020

  reply	other threads:[~2016-08-17 22:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 22:04 [RFC PATCH v2 0/4] Type-C Port Manager Guenter Roeck
2016-08-17 22:04 ` Guenter Roeck [this message]
2016-08-17 22:04 ` [RFC PATCH v2 2/4] usb: typec: Do not update modes in class driver Guenter Roeck
2016-08-17 22:04 ` [RFC PATCH v2 3/4] usb: typec: USB Type-C Port Manager (tcpm) Guenter Roeck
2016-08-17 22:04 ` [RFC PATCH v2 4/4] usb: typec: Type-C Port Controller Interface driver (tcpci) Guenter Roeck
2016-08-18  7:43 ` [RFC PATCH v2 0/4] Type-C Port Manager Oliver Neukum
2016-08-18 13:17   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471471476-53251-2-git-send-email-groeck@chromium.org \
    --to=groeck@chromium.org \
    --cc=bin.gao@intel.com \
    --cc=bruce.ashfield@windriver.com \
    --cc=chandra.sekhar.anagani@intel.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pranav.tipnis@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®