diff mbox series

gpio: logicvc: remove unneeded platform_set_drvdata() call

Message ID 20230719094803.17677-1-aboutphysycs@gmail.com
State Accepted
Commit 8020619ad785c87e807ca9f782238294c2a602e0
Headers show
Series gpio: logicvc: remove unneeded platform_set_drvdata() call | expand

Commit Message

Andrei Coardos July 19, 2023, 9:48 a.m. UTC
The platform_set_drvdata() isn't needed for anything. The function is a
simple setter that doesn't change anything in the code. That is because
there isn't a get function and since it has no dependencies it can be
removed.

Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
---
 drivers/gpio/gpio-logicvc.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Bartosz Golaszewski July 29, 2023, 2:06 p.m. UTC | #1
On Wed, Jul 19, 2023 at 11:48 AM Andrei Coardos <aboutphysycs@gmail.com> wrote:
>
> The platform_set_drvdata() isn't needed for anything. The function is a
> simple setter that doesn't change anything in the code. That is because
> there isn't a get function and since it has no dependencies it can be
> removed.
>
> Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
> ---
>  drivers/gpio/gpio-logicvc.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-logicvc.c b/drivers/gpio/gpio-logicvc.c
> index 992cc958a43f..9b4789deae45 100644
> --- a/drivers/gpio/gpio-logicvc.c
> +++ b/drivers/gpio/gpio-logicvc.c
> @@ -139,8 +139,6 @@ static int logicvc_gpio_probe(struct platform_device *pdev)
>         logicvc->chip.set = logicvc_gpio_set;
>         logicvc->chip.direction_output = logicvc_gpio_direction_output;
>
> -       platform_set_drvdata(pdev, logicvc);
> -
>         return devm_gpiochip_add_data(dev, &logicvc->chip, logicvc);
>  }
>
> --
> 2.34.1
>

Applied, thanks!

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-logicvc.c b/drivers/gpio/gpio-logicvc.c
index 992cc958a43f..9b4789deae45 100644
--- a/drivers/gpio/gpio-logicvc.c
+++ b/drivers/gpio/gpio-logicvc.c
@@ -139,8 +139,6 @@  static int logicvc_gpio_probe(struct platform_device *pdev)
 	logicvc->chip.set = logicvc_gpio_set;
 	logicvc->chip.direction_output = logicvc_gpio_direction_output;
 
-	platform_set_drvdata(pdev, logicvc);
-
 	return devm_gpiochip_add_data(dev, &logicvc->chip, logicvc);
 }