Skip to contentSkip to conversation

gpio: max77620: remove unneeded platform_set_drvdata() call

PATCH Applied Andrei Coardos 3 participants 3 messages Jul 25, 2023 – Aug 1, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpio: max77620: remove unneeded platform_set_drvdata() call

This function call is not required because no counterpart platform_get_drvdata() call is present to leverage the private data of the driver.
Since the private data is confined to this driver file, external access is not feasible.
The use of this function appears redundant in the current context of the driver's implementation.

---

Changelog V1->V2:

* https://lore.kernel.org/linux-gpio/[email protected]/
* fixed subject line: adjusted colons where needed

 drivers/gpio/gpio-max77620.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpio-max77620.c +0 -2
index c18b60e39a94..8c2a5609161f 100644
@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev)
 	girq->init_hw = max77620_gpio_irq_init_hw;
 	girq->threaded = true;
 
-	platform_set_drvdata(pdev, mgpio);
-
 	ret = devm_gpiochip_add_data(&pdev->dev, &mgpio->gpio_chip, mgpio);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "gpio_init: Failed to add max77620_gpio\n");
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Andrei Coardos

This function call is not required because no counterpart platform_get_drvdata() call is present to leverage the private data of the driver.
Since the private data is confined to this driver file, external access is not feasible.
The use of this function appears redundant in the current context of the driver's implementation.

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

This function call is not required because no counterpart platform_get_drvdata() call is present to leverage the private data of the driver.
Since the private data is confined to this driver file, external access is not feasible.
The use of this function appears redundant in the current context of the driver's implementation.

---

Changelog V1->V2:

* https://lore.kernel.org/linux-gpio/[email protected]/
* fixed subject line: adjusted colons where needed

 drivers/gpio/gpio-max77620.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpio-max77620.c +0 -3
index c18b60e39a94..8c2a5609161f 100644
@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev)
        girq->init_hw = max77620_gpio_irq_init_hw;
        girq->threaded = true;
 
-       platform_set_drvdata(pdev, mgpio);
-
        ret = devm_gpiochip_add_data(&pdev->dev, &mgpio->gpio_chip, mgpio);
        if (ret < 0) {
                dev_err(&pdev->dev, "gpio_init: Failed to add max77620_gpio\n");
--
Quoted 2 lines

2.34.1

Applied, thanks!

Bartosz