Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455449 > unrolled thread

[RFC PATCH 2/4] usb: typec: Do not check if connected when setting roles

Started byGuenter Roeck <groeck@chromium.org>
First post2016-08-02 22:40 +0200
Last post2016-08-02 22:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 2/4] usb: typec: Do not check if connected when setting roles Guenter Roeck <groeck@chromium.org> - 2016-08-02 22:40 +0200

#1455449 — [RFC PATCH 2/4] usb: typec: Do not check if connected when setting roles

FromGuenter Roeck <groeck@chromium.org>
Date2016-08-02 22:40 +0200
Subject[RFC PATCH 2/4] usb: typec: Do not check if connected when setting roles
Message-ID<s1ODL-16D-1@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web