Skip to contentSkip to conversation

gpio: sama5d2-piobu: remove unneeded call to platform_set_drvdata()

PATCH Applied Andrei Coardos 4 participants 4 messages Jul 28, 2023 – Aug 2, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: sama5d2-piobu: remove unneeded 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-sama5d2-piobu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-sama5d2-piobu.c +0 -1
index 767c33ae3213..d89da7300ddd 100644
@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)
 	if (!piobu)
 		return -ENOMEM;
 
-	platform_set_drvdata(pdev, piobu);
 	piobu->chip.label = pdev->name;
 	piobu->chip.parent = &pdev->dev;
 	piobu->chip.owner = THIS_MODULE,
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-sama5d2-piobu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-sama5d2-piobu.c +0 -2
index 767c33ae3213..d89da7300ddd 100644
@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)
        if (!piobu)
                return -ENOMEM;
 
-       platform_set_drvdata(pdev, piobu);
        piobu->chip.label = pdev->name;
        piobu->chip.parent = &pdev->dev;
        piobu->chip.owner = THIS_MODULE,
--
Quoted 2 lines

2.34.1

Applied, thanks!

Bartosz

Reviewed-by on v1 1/1
#3 lore raw
In reply to Andrei Coardos
Quoted 7 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.

Quoted 16 lines
---
 drivers/gpio/gpio-sama5d2-piobu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-sama5d2-piobu.c +0 -1
index 767c33ae3213..d89da7300ddd 100644
@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)
 	if (!piobu)
 		return -ENOMEM;
 
-	platform_set_drvdata(pdev, piobu);
 	piobu->chip.label = pdev->name;
 	piobu->chip.parent = &pdev->dev;
 	piobu->chip.owner = THIS_MODULE,