pinctrl: st: Switch to use fwnode instead of of_node
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 10 Oct 2022 07:56:15 +0000 (10:56 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 17 Oct 2022 10:10:53 +0000 (12:10 +0200)
The OF node in the GPIO library is deprecated and soon
will be removed.

GPIO library now accepts fwnode as a firmware node, so
switch the driver to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20221010075615.43244-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-st.c

index cf7f9cbe604400e9f20889f432c6ddce27bbc890..987878c83349d995f0b3bbc20fd5386d162f2030 100644 (file)
@@ -1175,7 +1175,7 @@ static int st_pctl_dt_calculate_pin(struct st_pinctrl *info,
 
        for (i = 0; i < info->nbanks; i++) {
                chip = &info->banks[i].gpio_chip;
-               if (chip->of_node == np) {
+               if (chip->fwnode == of_fwnode_handle(np)) {
                        if (offset < chip->ngpio)
                                retval = chip->base + offset;
                        break;
@@ -1518,7 +1518,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
        bank->gpio_chip = st_gpio_template;
        bank->gpio_chip.base = bank_num * ST_GPIO_PINS_PER_BANK;
        bank->gpio_chip.ngpio = ST_GPIO_PINS_PER_BANK;
-       bank->gpio_chip.of_node = np;
+       bank->gpio_chip.fwnode = of_fwnode_handle(np);
        bank->gpio_chip.parent = dev;
        spin_lock_init(&bank->lock);