Skip to contentSkip to conversation

thermal: sun8i_thermal: remove unneeded call to platform_set_drvdata()

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

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

PATCH 1/1 thermal: sun8i_thermal: 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/thermal/sun8i_thermal.c | 2 --
 1 file changed, 2 deletions(-)
drivers/thermal/sun8i_thermal.c +0 -2
index 195f3c5d0b38..61a2f287ac90 100644
@@ -489,8 +489,6 @@ static int sun8i_ths_probe(struct platform_device *pdev)
 	if (!tmdev->chip)
 		return -EINVAL;
 
-	platform_set_drvdata(pdev, tmdev);
-
 	ret = sun8i_ths_resource_init(tmdev);
 	if (ret)
 		return ret;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Dne petek, 11. avgust 2023 ob 21:40:32 CEST je Andrei Coardos napisal(a):

Quoted 6 lines

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.

Best regards,
Jernej

Quoted 17 lines
---
 drivers/thermal/sun8i_thermal.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/thermal/sun8i_thermal.c index 195f3c5d0b38..61a2f287ac90 100644

drivers/thermal/sun8i_thermal.c +0 -2
@@ -489,8 +489,6 @@ static int sun8i_ths_probe(struct platform_device *pdev)
 if (!tmdev->chip)
 		return -EINVAL;
 
-	platform_set_drvdata(pdev, tmdev);
-
 	ret = sun8i_ths_resource_init(tmdev);
 	if (ret)
 		return ret;
Reviewed-by
#2 lore raw
Quoted 9 lines · Jernej Škrabec

Dne petek, 11. avgust 2023 ob 21:40:32 CEST je Andrei Coardos napisal(a):

Quoted 6 lines

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 26 lines

Best regards,
Jernej

Quoted 17 lines
---
 drivers/thermal/sun8i_thermal.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/thermal/sun8i_thermal.c index 195f3c5d0b38..61a2f287ac90 100644

drivers/thermal/sun8i_thermal.c +0 -2
@@ -489,8 +489,6 @@ static int sun8i_ths_probe(struct platform_device *pdev)
 if (!tmdev->chip)
              return -EINVAL;
 
-     platform_set_drvdata(pdev, tmdev);
-
      ret = sun8i_ths_resource_init(tmdev);
      if (ret)
              return ret;
#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.

---

Applied, thanks

Are you checking neither dev_get_drvdata is used ?

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