Mode updates need to be triggered and reported by underlying drivers.
Also add missing "if (ret)".

Signed-off-by: Guenter Roeck <gro...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to