[linux-yocto] [PATCH] gpio-pca953x: fix the "drive" property cannot read/write

Yong Li yong.b.li at intel.com
Fri Apr 1 08:12:11 PDT 2016


The gpio_drive_show/store use incorrect gpio_desc,
this causes the drive sysfs property cannot be used,
This patch fixes this issue

Upstream-status: Inappropriate, custom code for legacy userspace

Signed-off-by: Yong Li <yong.b.li at intel.com>
---
 drivers/gpio/gpiolib-sysfs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index b60e477..6c6127d 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -355,7 +355,8 @@ static DEVICE_ATTR_RW(active_low);
 static ssize_t gpio_drive_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
-	const struct gpio_desc	*desc = dev_get_drvdata(dev);
+	struct gpiod_data       *data = dev_get_drvdata(dev);
+	struct gpio_desc        *desc = data->desc;
 	ssize_t			status;
 
 	mutex_lock(&sysfs_lock);
@@ -382,7 +383,8 @@ static ssize_t gpio_drive_show(struct device *dev,
 static ssize_t gpio_drive_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t size)
 {
-	struct gpio_desc	*desc = dev_get_drvdata(dev);
+	struct gpiod_data       *data = dev_get_drvdata(dev);
+	struct gpio_desc        *desc = data->desc;
 	ssize_t			status;
 
 	mutex_lock(&sysfs_lock);
-- 
2.1.4



More information about the linux-yocto mailing list