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 2/4] usb: typec: Do not check if connected when setting roles
Date: Tue,  2 Aug 2016 13:32:53 -0700	[thread overview]
Message-ID: <1470169975-19941-3-git-send-email-groeck@chromium.org> (raw)
In-Reply-To: <1470169975-19941-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>
---
 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 0d0ebed..a0ae0d6 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -859,9 +859,6 @@ current_data_role_store(struct device *dev, struct device_attribute *attr,
 		return -EOPNOTSUPP;
 	}
 
-	if (!port->connected)
-		return size;
-
 	ret = match_string(typec_data_roles, ARRAY_SIZE(typec_data_roles), buf);
 	if (ret < 0)
 		return ret;
@@ -918,9 +915,6 @@ static ssize_t current_power_role_store(struct device *dev,
 		return -EIO;
 	}
 
-	if (!port->connected)
-		return size;
-
 	ret = match_string(typec_roles, ARRAY_SIZE(typec_roles), buf);
 	if (ret < 0)
 		return ret;
-- 
2.6.6

  parent reply	other threads:[~2016-08-02 20:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 20:32 [RFC PATCH 0/4] Type-C Port Manager Guenter Roeck
2016-08-02 20:32 ` [RFC PATCH 1/4] usb: typec: Drop locking from class code Guenter Roeck
2016-08-02 20:32 ` Guenter Roeck [this message]
2016-08-02 20:32 ` [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm) Guenter Roeck
2016-08-03  9:18   ` Oliver Neukum
2016-08-03 18:03     ` Guenter Roeck
2016-08-03  9:28   ` Oliver Neukum
2016-08-03 18:46     ` Guenter Roeck
2016-08-02 20:32 ` [RFC PATCH 4/4] usb: typec: Type-C Port Controller Interface driver (tcpci) 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=1470169975-19941-3-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®