Skip to contentSkip to conversation

thermal: mediatek: auxadc_thermal: removed call to platform_set_drvdata()

PATCH Applied Andrei Coardos 3 participants 3 messages Aug 11, 2023 – Aug 16, 2023

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

PATCH 1/1 thermal: mediatek: auxadc_thermal: removed 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/thermal/mediatek/auxadc_thermal.c | 2 --
 1 file changed, 2 deletions(-)
drivers/thermal/mediatek/auxadc_thermal.c +0 -2
index f59d36de20a0..99a1c35c68e7 100644
@@ -1283,8 +1283,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
 			mtk_thermal_init_bank(mt, i, apmixed_phys_base,
 					      auxadc_phys_base, ctrl_id);
 
-	platform_set_drvdata(pdev, mt);
-
 	tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
 					      &mtk_thermal_ops);
 	if (IS_ERR(tzdev))
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 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 21 lines
---
 drivers/thermal/mediatek/auxadc_thermal.c | 2 --
 1 file changed, 2 deletions(-)
drivers/thermal/mediatek/auxadc_thermal.c +0 -3
index f59d36de20a0..99a1c35c68e7 100644
@@ -1283,8 +1283,6 @@ static int mtk_thermal_probe(struct platform_device *pdev)
                        mtk_thermal_init_bank(mt, i, apmixed_phys_base,
                                              auxadc_phys_base, ctrl_id);
 
-       platform_set_drvdata(pdev, mt);
-
        tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt,
                                              &mtk_thermal_ops);
        if (IS_ERR(tzdev))
--

2.34.1

#2 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.

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog