2023-07-12 10:04:48

by Alexandru Ardelean

[permalink] [raw]
Subject: [PATCH] gpio: 74xx-mmio: remove unneeded platform_set_drvdata() call

The platform_set_drvdata() was needed when the driver had an explicit
remove function.
That function got removed a while back, so we don't need to keep a pointer
(on 'dev->driver_data') for the private data of the driver anymore.

Signed-off-by: Alexandru Ardelean <[email protected]>
---
drivers/gpio/gpio-74xx-mmio.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
index 0464f1ecd20d..c7ac5a9ffb1f 100644
--- a/drivers/gpio/gpio-74xx-mmio.c
+++ b/drivers/gpio/gpio-74xx-mmio.c
@@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev)
priv->gc.ngpio = MMIO_74XX_BIT_CNT(priv->flags);
priv->gc.owner = THIS_MODULE;

- platform_set_drvdata(pdev, priv);
-
return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
}

--
2.40.1



2023-07-12 10:56:34

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74xx-mmio: remove unneeded platform_set_drvdata() call

On Wed, Jul 12, 2023 at 12:49 PM Alexandru Ardelean <[email protected]> wrote:
>
> The platform_set_drvdata() was needed when the driver had an explicit
> remove function.
> That function got removed a while back, so we don't need to keep a pointer
> (on 'dev->driver_data') for the private data of the driver anymore.

Reviewed-by: Andy Shevchenko <[email protected]>

> Signed-off-by: Alexandru Ardelean <[email protected]>
> ---
> drivers/gpio/gpio-74xx-mmio.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
> index 0464f1ecd20d..c7ac5a9ffb1f 100644
> --- a/drivers/gpio/gpio-74xx-mmio.c
> +++ b/drivers/gpio/gpio-74xx-mmio.c
> @@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev)
> priv->gc.ngpio = MMIO_74XX_BIT_CNT(priv->flags);
> priv->gc.owner = THIS_MODULE;
>
> - platform_set_drvdata(pdev, priv);
> -
> return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
> }
>
> --
> 2.40.1
>


--
With Best Regards,
Andy Shevchenko

2023-07-20 19:52:12

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74xx-mmio: remove unneeded platform_set_drvdata() call

On Wed, Jul 12, 2023 at 11:49 AM Alexandru Ardelean <[email protected]> wrote:

> The platform_set_drvdata() was needed when the driver had an explicit
> remove function.
> That function got removed a while back, so we don't need to keep a pointer
> (on 'dev->driver_data') for the private data of the driver anymore.
>
> Signed-off-by: Alexandru Ardelean <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2023-07-29 16:11:37

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH] gpio: 74xx-mmio: remove unneeded platform_set_drvdata() call

On Wed, Jul 12, 2023 at 11:49 AM Alexandru Ardelean <[email protected]> wrote:
>
> The platform_set_drvdata() was needed when the driver had an explicit
> remove function.
> That function got removed a while back, so we don't need to keep a pointer
> (on 'dev->driver_data') for the private data of the driver anymore.
>
> Signed-off-by: Alexandru Ardelean <[email protected]>
> ---
> drivers/gpio/gpio-74xx-mmio.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
> index 0464f1ecd20d..c7ac5a9ffb1f 100644
> --- a/drivers/gpio/gpio-74xx-mmio.c
> +++ b/drivers/gpio/gpio-74xx-mmio.c
> @@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev)
> priv->gc.ngpio = MMIO_74XX_BIT_CNT(priv->flags);
> priv->gc.owner = THIS_MODULE;
>
> - platform_set_drvdata(pdev, priv);
> -
> return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
> }
>
> --
> 2.40.1
>

Applied, thanks!

Bart