diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-12-06 15:18:52 +0200 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2021-12-17 17:50:46 +0100 |
commit | 6dbe6c07f94f349098b512d88a1e1c5e2312b13d (patch) | |
tree | f9b6be6937c13c8494ba5263cb0f5b1ab8fc503e /drivers/gpio/gpio-tps65910.c | |
parent | 45a541a610af8156ee623b5906515796405ae9f5 (diff) | |
download | lwn-6dbe6c07f94f349098b512d88a1e1c5e2312b13d.tar.gz lwn-6dbe6c07f94f349098b512d88a1e1c5e2312b13d.zip |
gpio: Propagate firmware node from a parent device
When creating MFD platform devices the firmware node is left unset.
This, in particular, prevents GPIO library to use it for different
purposes. Propagate firmware node from the parent device and let
GPIO library do the right thing.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpio-tps65910.c')
-rw-r--r-- | drivers/gpio/gpio-tps65910.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c index 7fa8c841081f..321e6945f0be 100644 --- a/drivers/gpio/gpio-tps65910.c +++ b/drivers/gpio/gpio-tps65910.c @@ -111,6 +111,8 @@ static int tps65910_gpio_probe(struct platform_device *pdev) int ret; int i; + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); + tps65910_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps65910_gpio), GFP_KERNEL); if (!tps65910_gpio) @@ -137,9 +139,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev) tps65910_gpio->gpio_chip.set = tps65910_gpio_set; tps65910_gpio->gpio_chip.get = tps65910_gpio_get; tps65910_gpio->gpio_chip.parent = &pdev->dev; -#ifdef CONFIG_OF_GPIO - tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node; -#endif + if (pdata && pdata->gpio_base) tps65910_gpio->gpio_chip.base = pdata->gpio_base; else |