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

Bruce Ashfield bruce.ashfield at windriver.com
Fri Apr 1 12:40:20 PDT 2016


On 2016-04-01 11:12 AM, Yong Li wrote:
> The gpio_drive_show/store use incorrect gpio_desc,
> this causes the drive sysfs property cannot be used,
> This patch fixes this issue

This is destined for linux-yocto_4.4, correct ?

Bruce

>
> 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);
>



More information about the linux-yocto mailing list