Skip to contentSkip to conversation

gpio: pmic-eic-sprd: remove unnecessary call to platform_set_drvdata()

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

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

PATCH 1/1 gpio: pmic-eic-sprd: 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-pmic-eic-sprd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-pmic-eic-sprd.c +0 -1
index c3e4d90f6b18..bfb003ccbd99 100644
@@ -363,7 +363,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, pmic_eic);
 	return 0;
 }
 
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-pmic-eic-sprd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpio/gpio-pmic-eic-sprd.c +0 -2
index c3e4d90f6b18..bfb003ccbd99 100644
@@ -363,7 +363,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
                return ret;
        }
 
-       platform_set_drvdata(pdev, pmic_eic);
        return 0;
 }
 
--
Quoted 2 lines

2.34.1

Applied, thanks!

Bartosz