diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-12-06 16:18:52 +0300 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2021-12-17 19:50:46 +0300 |
commit | 6dbe6c07f94f349098b512d88a1e1c5e2312b13d (patch) | |
tree | f9b6be6937c13c8494ba5263cb0f5b1ab8fc503e /drivers/gpio/gpio-tps6586x.c | |
parent | 45a541a610af8156ee623b5906515796405ae9f5 (diff) | |
download | linux-6dbe6c07f94f349098b512d88a1e1c5e2312b13d.tar.xz |
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-tps6586x.c')
-rw-r--r-- | drivers/gpio/gpio-tps6586x.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c index da0304b764a5..c5713524b581 100644 --- a/drivers/gpio/gpio-tps6586x.c +++ b/drivers/gpio/gpio-tps6586x.c @@ -77,6 +77,8 @@ static int tps6586x_gpio_probe(struct platform_device *pdev) struct tps6586x_platform_data *pdata; struct tps6586x_gpio *tps6586x_gpio; + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); + pdata = dev_get_platdata(pdev->dev.parent); tps6586x_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps6586x_gpio), GFP_KERNEL); @@ -97,9 +99,6 @@ static int tps6586x_gpio_probe(struct platform_device *pdev) tps6586x_gpio->gpio_chip.get = tps6586x_gpio_get; tps6586x_gpio->gpio_chip.to_irq = tps6586x_gpio_to_irq; -#ifdef CONFIG_OF_GPIO - tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node; -#endif if (pdata && pdata->gpio_base) tps6586x_gpio->gpio_chip.base = pdata->gpio_base; else |