diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-12-14 13:58:54 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-12-16 04:18:30 +0100 |
commit | 8a8d6bbe1d3bc7137c777ba06246d7e9c08dde4d (patch) | |
tree | d4ca8e3684bd991797c60a1f8a0ab999bf339e73 /drivers/pinctrl/mediatek/pinctrl-moore.c | |
parent | pinctrl-sunxi: don't call pinctrl_gpio_direction() (diff) | |
download | linux-8a8d6bbe1d3bc7137c777ba06246d7e9c08dde4d.tar.xz linux-8a8d6bbe1d3bc7137c777ba06246d7e9c08dde4d.zip |
pinctrl: Get rid of duplicate of_node assignment in the drivers
GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove these assignment all at once.
For the details one may look into the of_gpio_dev_init() implementation.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211214125855.33207-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mediatek/pinctrl-moore.c')
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-moore.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/mediatek/pinctrl-moore.c index ad3b67163973..5bfaa84839c7 100644 --- a/drivers/pinctrl/mediatek/pinctrl-moore.c +++ b/drivers/pinctrl/mediatek/pinctrl-moore.c @@ -519,7 +519,7 @@ static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset, return mtk_eint_set_debounce(hw->eint, desc->eint.eint_n, debounce); } -static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np) +static int mtk_build_gpiochip(struct mtk_pinctrl *hw) { struct gpio_chip *chip = &hw->chip; int ret; @@ -536,7 +536,6 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np) chip->set_config = mtk_gpio_set_config; chip->base = -1; chip->ngpio = hw->soc->npins; - chip->of_node = np; chip->of_gpio_n_cells = 2; ret = gpiochip_add_data(chip, hw); @@ -550,7 +549,7 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np) * Documentation/devicetree/bindings/gpio/gpio.txt on how to * bind pinctrl and gpio drivers via the "gpio-ranges" property. */ - if (!of_find_property(np, "gpio-ranges", NULL)) { + if (!of_find_property(hw->dev->of_node, "gpio-ranges", NULL)) { ret = gpiochip_add_pin_range(chip, dev_name(hw->dev), 0, 0, chip->ngpio); if (ret < 0) { @@ -691,7 +690,7 @@ int mtk_moore_pinctrl_probe(struct platform_device *pdev, "Failed to add EINT, but pinctrl still can work\n"); /* Build gpiochip should be after pinctrl_enable is done */ - err = mtk_build_gpiochip(hw, pdev->dev.of_node); + err = mtk_build_gpiochip(hw); if (err) { dev_err(&pdev->dev, "Failed to add gpio_chip\n"); return err; |