Skip to contentSkip to conversation

clocksource: sh_tmu: remove unnecessary platform_set_drvdata()

PATCH In review Jingoo Han 2 participants 3 messages Aug 21, 2013 – Aug 22, 2013 Clocksource, clockevent drivers

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/2 clocksource: sh_tmu: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/clocksource/sh_tmu.c |    1 -
 1 file changed, 1 deletion(-)
drivers/clocksource/sh_tmu.c +0 -1
index 78b8dae..54ab475 100644
@@ -509,7 +509,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
 	ret = sh_tmu_setup(p, pdev);
 	if (ret) {
 		kfree(p);
-		platform_set_drvdata(pdev, NULL);
 		pm_runtime_idle(&pdev->dev);
 		return ret;
 	}
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/2 clocksource: sh_mtu2: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/clocksource/sh_mtu2.c |    1 -
 1 file changed, 1 deletion(-)
drivers/clocksource/sh_mtu2.c +0 -1
index 4aac9ee..f02648e 100644
@@ -346,7 +346,6 @@ static int sh_mtu2_probe(struct platform_device *pdev)
 	ret = sh_mtu2_setup(p, pdev);
 	if (ret) {
 		kfree(p);
-		platform_set_drvdata(pdev, NULL);
 		pm_runtime_idle(&pdev->dev);
 		return ret;
 	}
Signature · 1 line
1.7.10.4
Acked-by on v1 1/2
#2 lore raw
In reply to Jingoo Han
Quoted 5 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

No objections for this and the following patch:

Daniel, let me know if you would prefer if I queued these up and sent you a pull request or you would rather just pick them up directly.

Quoted 20 lines
---
 drivers/clocksource/sh_tmu.c |    1 -
 1 file changed, 1 deletion(-)
drivers/clocksource/sh_tmu.c +0 -1
index 78b8dae..54ab475 100644
@@ -509,7 +509,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
 	ret = sh_tmu_setup(p, pdev);
 	if (ret) {
 		kfree(p);
-		platform_set_drvdata(pdev, NULL);
 		pm_runtime_idle(&pdev->dev);
 		return ret;
 	}
Signature · 1 line
1.7.10.4