Skip to contentSkip to conversation

cpufreq: brcmstb-avs-cpufreq: remove unnecessary platform_set_drvdata()

PATCH New Wei Yongjun 2 participants 2 messages Feb 7, 2017 – Feb 8, 2017

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

PATCH 1/1 cpufreq: brcmstb-avs-cpufreq: remove unnecessary platform_set_drvdata()

From: Wei Yongjun <[email protected]>

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/cpufreq/brcmstb-avs-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +0 -2
index c943606..7281a2c 100644
@@ -878,7 +878,6 @@ static int brcm_avs_prepare_init(struct platform_device *pdev)
 	iounmap(priv->avs_intr_base);
 unmap_base:
 	iounmap(priv->base);
-	platform_set_drvdata(pdev, NULL);
 
 	return ret;
 }
@@ -1042,7 +1041,6 @@ static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
 	priv = platform_get_drvdata(pdev);
 	iounmap(priv->base);
 	iounmap(priv->avs_intr_base);
-	platform_set_drvdata(pdev, NULL);
 
 	return 0;
 }
maintainer
#1 lore raw

PATCH 1/1 cpufreq: brcmstb-avs-cpufreq: remove unnecessary platform_set_drvdata()

Quoted 24 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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/cpufreq/brcmstb-avs-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +0 -1
index c943606..7281a2c 100644
@@ -878,7 +878,6 @@ static int brcm_avs_prepare_init(struct platform_device *pdev)
 	iounmap(priv->avs_intr_base);
 unmap_base:
 	iounmap(priv->base);
-	platform_set_drvdata(pdev, NULL);
 
 	return ret;
 }

drivers/cpufreq/brcmstb-avs-cpufreq.c static int brcm_avs_cpufreq_remove(struct platform_device *pdev) · line 1046

Quoted 7 lines
drivers/cpufreq/brcmstb-avs-cpufreq.c +0 -1
@@ -1042,7 +1041,6 @@ static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
 	priv = platform_get_drvdata(pdev);
 	iounmap(priv->base);
 	iounmap(priv->avs_intr_base);
-	platform_set_drvdata(pdev, NULL);
 
 	return 0;
 }
Signature · 1 line
viresh