[-next] cpufreq: brcmstb-avs-cpufreq: remove unnecessary platform_set_drvdata()
diff mbox

Message ID 20170207155645.5455-1-weiyj.lk@gmail.com
State Mainlined
Delegated to: Rafael Wysocki
Headers show

Commit Message

Wei Yongjun Feb. 7, 2017, 3:56 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 --
 1 file changed, 2 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Viresh Kumar Feb. 8, 2017, 3:19 a.m. UTC | #1
On 07-02-17, 15:56, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> 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.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> index c943606..7281a2c 100644
> --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
> +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
> @@ -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;
>  }

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Patch
diff mbox

diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index c943606..7281a2c 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -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;
 }