Message ID | 20230213154532.32992-4-andriy.shevchenko@linux.intel.com |
---|---|
State | Superseded |
Headers | show |
Series | pinctrl: at91: Cleanups | expand |
On 13.02.2023 17:45, Andy Shevchenko wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > 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> > --- > drivers/pinctrl/pinctrl-at91.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c > index 6d9015ed8a3b..055a88b2dacc 100644 > --- a/drivers/pinctrl/pinctrl-at91.c > +++ b/drivers/pinctrl/pinctrl-at91.c > @@ -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; > > -- > 2.39.1 >
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 6d9015ed8a3b..055a88b2dacc 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -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;
Use of_device_get_match_data() to simplify the code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/pinctrl/pinctrl-at91.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)