Skip to content

Commit

Permalink
gpio: generic: Add label to platform data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pawel Moll authored and Linus Walleij committed Feb 6, 2014
1 parent b7ab697 commit 781f6d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpio/gpio-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions include/linux/basic_mmio_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/spinlock_types.h>

struct bgpio_pdata {
const char *label;
int base;
int ngpio;
};
Expand Down

0 comments on commit 781f6d7

Please sign in to comment.