diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c index 5bb511204214..7d062f9a2c6a 100644 --- a/drivers/gpio/gpio-mmio.c +++ b/drivers/gpio/gpio-mmio.c @@ -715,6 +715,9 @@ MODULE_DEVICE_TABLE(of, bgpio_of_match); static struct bgpio_pdata *bgpio_parse_fw(struct device *dev, unsigned long *flags) { struct bgpio_pdata *pdata; + const char *label; + unsigned int base; + int ret; if (!dev_fwnode(dev)) return NULL; @@ -731,6 +734,18 @@ static struct bgpio_pdata *bgpio_parse_fw(struct device *dev, unsigned long *fla if (device_property_read_bool(dev, "no-output")) *flags |= BGPIOF_NO_OUTPUT; + ret = device_property_read_string(dev, "label", &label); + if (!ret) + pdata->label = label; + + /* + * This property *must not* be used in device-tree sources, it's only + * meant to be passed to the driver from board files and MFD core. + */ + ret = device_property_read_u32(dev, "gpio-mmio,base", &base); + if (!ret && base <= INT_MAX) + pdata->base = base; + return pdata; }