lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 17 Aug 2016 15:04:34 -0700
From:	Guenter Roeck <groeck@...omium.org>
To:	Felipe Balbi <felipe.balbi@...ux.intel.com>
Cc:	Chandra Sekhar Anagani <chandra.sekhar.anagani@...el.com>,
	Bruce Ashfield <bruce.ashfield@...driver.com>,
	Bin Gao <bin.gao@...el.com>,
	Pranav Tipnis <pranav.tipnis@...el.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	Guenter Roeck <groeck@...omium.org>
Subject: [RFC PATCH v2 2/4] usb: typec: Do not update modes in class driver

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ