Skip to contentSkip to conversation

gpio: logicvc: remove unneeded platform_set_drvdata() call

PATCH Applied Andrei Coardos 3 participants 3 messages Jul 19, 2023 – Jul 29, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: logicvc: remove unneeded platform_set_drvdata() call

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.

---
 drivers/gpio/gpio-logicvc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpio-logicvc.c +0 -2
index 992cc958a43f..9b4789deae45 100644
@@ -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);
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andrei Coardos

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to Andrei Coardos
Quoted 26 lines · Andrei Coardos

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.

---
 drivers/gpio/gpio-logicvc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpio-logicvc.c +0 -3
index 992cc958a43f..9b4789deae45 100644
@@ -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);
 }
 
--
Quoted 2 lines

2.34.1

Applied, thanks!

Bart