pinctrl: at91: Use of_device_get_match_data()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 15 Feb 2023 13:42:40 +0000 (15:42 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 6 Mar 2023 12:52:34 +0000 (13:52 +0100)
Use of_device_get_match_data() to simplify the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230215134242.37618-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-at91.c

index f0b139a..8a8de1c 100644 (file)
@@ -1304,8 +1304,7 @@ static int at91_pinctrl_probe_dt(struct platform_device *pdev,
                return -ENODEV;
 
        info->dev = &pdev->dev;
-       info->ops = (const struct at91_pinctrl_mux_ops *)
-               of_match_device(at91_pinctrl_of_match, &pdev->dev)->data;
+       info->ops = of_device_get_match_data(dev);
        at91_pinctrl_child_count(info, np);
 
        /*
@@ -1844,8 +1843,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
                goto err;
        }
 
-       at91_chip->ops = (const struct at91_pinctrl_mux_ops *)
-               of_match_device(at91_gpio_of_match, &pdev->dev)->data;
+       at91_chip->ops = of_device_get_match_data(dev);
        at91_chip->pioc_virq = irq;
        at91_chip->pioc_idx = alias_idx;