lkml.org 
[lkml]   [2016]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 2/4] usb: typec: Do not check if connected when setting roles
Date
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
\
 
 \ /
  Last update: 2016-08-02 23:21    [W:0.062 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site