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 d2196bf..8c778af 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 d8a97ec..0e97856 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/spinlock_types.h>
 
 struct bgpio_pdata {
+       const char *label;
        int base;
        int ngpio;
 };