mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
gpio: generic: Add label to platform data
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>
This commit is contained in:
parent
b7ab697369
commit
781f6d710d
@ -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;
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <linux/spinlock_types.h>
|
||||
|
||||
struct bgpio_pdata {
|
||||
const char *label;
|
||||
int base;
|
||||
int ngpio;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user