diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-12-16 17:12:27 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-12-22 03:09:56 +0100 |
commit | ce852837335abc874e4d943ebbbe7432465a413b (patch) | |
tree | 224d23d17fea7281f3dffec8c1d70c5301009eca /drivers/pinctrl/pinctrl-as3722.c | |
parent | 744d04fb4836cc1778cbe853fcac503794ba6fdf (diff) |
pinctrl: 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.
While at it, slightly modify the headers to reflect the usage of APIs.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20211216151227.58687-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-as3722.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-as3722.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index 13c193156363..4313756b52e6 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c @@ -23,19 +23,20 @@ #include <linux/delay.h> #include <linux/gpio/driver.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/mfd/as3722.h> -#include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/pm.h> +#include <linux/property.h> +#include <linux/slab.h> + #include <linux/pinctrl/consumer.h> #include <linux/pinctrl/machine.h> #include <linux/pinctrl/pinctrl.h> #include <linux/pinctrl/pinconf-generic.h> #include <linux/pinctrl/pinconf.h> #include <linux/pinctrl/pinmux.h> -#include <linux/pm.h> -#include <linux/slab.h> #include "core.h" #include "pinconf.h" @@ -551,12 +552,13 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) struct as3722_pctrl_info *as_pci; int ret; + device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent)); + as_pci = devm_kzalloc(&pdev->dev, sizeof(*as_pci), GFP_KERNEL); if (!as_pci) return -ENOMEM; as_pci->dev = &pdev->dev; - as_pci->dev->of_node = pdev->dev.parent->of_node; as_pci->as3722 = dev_get_drvdata(pdev->dev.parent); platform_set_drvdata(pdev, as_pci); @@ -578,7 +580,6 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) as_pci->gpio_chip = as3722_gpio_chip; as_pci->gpio_chip.parent = &pdev->dev; - as_pci->gpio_chip.of_node = pdev->dev.parent->of_node; ret = gpiochip_add_data(&as_pci->gpio_chip, as_pci); if (ret < 0) { dev_err(&pdev->dev, "Couldn't register gpiochip, %d\n", ret); |