Skip to contentSkip to conversation

gpio: palmas: remove unnecessary call to platform_set_drvdata()

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: palmas: remove unnecessary call to platform_set_drvdata()

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

---
 drivers/gpio/gpio-palmas.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-palmas.c +0 -1
index bac10c2faf56..dd8a287ff6d0 100644
@@ -184,7 +184,6 @@ static int palmas_gpio_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, palmas_gpio);
 	return ret;
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Andrei Coardos

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

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

This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file.

---
 drivers/gpio/gpio-palmas.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-palmas.c +0 -2
index bac10c2faf56..dd8a287ff6d0 100644
@@ -184,7 +184,6 @@ static int palmas_gpio_probe(struct platform_device *pdev)
                return ret;
        }
 
-       platform_set_drvdata(pdev, palmas_gpio);
        return ret;
 }
 
--
Quoted 2 lines

2.34.1

Applied, thanks!

Bartosz