[PATCH 05/12] GPIO: gpio-generic: Add label to platform data

Lee Jones lee.jones at linaro.org
Tue Feb 11 12:17:21 EST 2014


> When registering more than one platform device, it is
> useful to set the gpio chip label in the platform data.
> 
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Cc: Alexandre Courbot <gnurou at gmail.com>
> Cc: Samuel Ortiz <sameo at linux.intel.com>
> Cc: Lee Jones <lee.jones at linaro.org>
> Signed-off-by: Pawel Moll <pawel.moll at arm.com>
> ---
> This patch has been already merged by Linux; it has been included
> for completeness only.
> 
>  drivers/gpio/gpio-generic.c     | 2 ++
>  include/linux/basic_mmio_gpio.h | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
> index d2196bf..8c778af 100644
> --- a/drivers/gpio/gpio-generic.c
> +++ b/drivers/gpio/gpio-generic.c
> @@ -531,6 +531,8 @@ static int bgpio_pdev_probe(struct platform_device *pdev)
>  		return err;
>  
>  	if (pdata) {
> +		if (pdata->label)

Why is this check necessary?

> +			bgc->gc.label = pdata->label;
>  		bgc->gc.base = pdata->base;
>  		if (pdata->ngpio > 0)
>  			bgc->gc.ngpio = pdata->ngpio;
> diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
> index d8a97ec..0e97856 100644
> --- a/include/linux/basic_mmio_gpio.h
> +++ b/include/linux/basic_mmio_gpio.h
> @@ -19,6 +19,7 @@
>  #include <linux/spinlock_types.h>
>  
>  struct bgpio_pdata {
> +	const char *label;
>  	int base;
>  	int ngpio;
>  };

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog



More information about the linux-arm-kernel mailing list