Messages in this thread Patch in this message | | | From | Guenter Roeck <> | Subject | [RFC PATCH v2 2/4] usb: typec: Do not update modes in class driver | Date | Wed, 17 Aug 2016 15:04:34 -0700 |
| |
Mode updates need to be triggered and reported by underlying drivers. Also add missing "if (ret)".
Signed-off-by: Guenter Roeck <groeck@chromium.org> --- v2: Added fixup patch
drivers/usb/typec/typec.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c index fa0261dad3b7..58de982ac927 100644 --- a/drivers/usb/typec/typec.c +++ b/drivers/usb/typec/typec.c @@ -533,7 +533,6 @@ typec_altmode_active_store(struct device *dev, struct device_attribute *attr, if (ret) return ret; - mode->active = activate; return size; } @@ -796,9 +795,6 @@ current_data_role_store(struct device *dev, struct device_attribute *attr, if (ret) return ret; - port->data_role = role; - sysfs_notify(&port->dev.kobj, NULL, "current_data_role"); - return size; } @@ -857,9 +853,6 @@ static ssize_t current_power_role_store(struct device *dev, ret = port->cap->pr_set(port->cap, role); return ret; - port->pwr_role = role; - sysfs_notify(&port->dev.kobj, NULL, "current_power_role"); - return size; } @@ -927,11 +920,9 @@ static ssize_t current_vconn_role_store(struct device *dev, role = ret; ret = port->cap->vconn_set(port->cap, role); + if (ret < 0) return ret; - port->pwr_role = role; - sysfs_notify(&port->dev.kobj, NULL, "current_vconn_role"); - return size; } -- 2.8.0.rc3.226.g39d4020
| |