gpio: generic: Add label to platform data
authorPawel Moll <pawel.moll@arm.com>
Thu, 30 Jan 2014 13:18:57 +0000 (13:18 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 6 Feb 2014 09:33:47 +0000 (10:33 +0100)
When registering more than one platform device, it is
useful to set the gpio chip label in the platform data.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-generic.c
include/linux/basic_mmio_gpio.h

index d2196bf738471fff1de061a2bbbeafee95b444f3..8c778afdf49f96e6f3e0094455bb60688eeed8a7 100644 (file)
@@ -531,6 +531,8 @@ static int bgpio_pdev_probe(struct platform_device *pdev)
                return err;
 
        if (pdata) {
+               if (pdata->label)
+                       bgc->gc.label = pdata->label;
                bgc->gc.base = pdata->base;
                if (pdata->ngpio > 0)
                        bgc->gc.ngpio = pdata->ngpio;
index d8a97ec0e2b8b16442a68343be5ee4af30efb718..0e97856b2cffafd8dc10218c95d2eae64169c17a 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/spinlock_types.h>
 
 struct bgpio_pdata {
+       const char *label;
        int base;
        int ngpio;
 };