diff mbox

[1/3] cpufreq: cpu0: Release clk and regulator in remove function

Message ID 1409209212-18730-1-git-send-email-pramod.gurav@smartplayin.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Pramod Gurav Aug. 28, 2014, 7 a.m. UTC
This function releases clk and regulator in remove function for clean
unloading.

CC: Shawn Guo <shawn.guo@linaro.org>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---
 drivers/cpufreq/cpufreq-cpu0.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Shawn Guo Aug. 28, 2014, 5:30 a.m. UTC | #1
On Thu, Aug 28, 2014 at 12:00:10AM -0700, Pramod Gurav wrote:
> This function releases clk and regulator in remove function for clean
> unloading.
> 
> CC: Shawn Guo <shawn.guo@linaro.org>
> CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> ---
>  drivers/cpufreq/cpufreq-cpu0.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index 0d2172b..e1574f8 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -229,6 +229,8 @@ static int cpu0_cpufreq_remove(struct platform_device *pdev)
>  	cpufreq_cooling_unregister(cdev);
>  	cpufreq_unregister_driver(&cpu0_cpufreq_driver);
>  	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
> +	clk_put(cpu_clk);
> +	regulator_put(cpu_reg);

cpu_reg is optional for the driver, so it's more logical to check the
availability before actually putting it?

Shawn

>  
>  	return 0;
>  }
> -- 
> 1.7.0.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Viresh Kumar Aug. 28, 2014, 5:53 a.m. UTC | #2
On Thu, Aug 28, 2014 at 12:30 PM, Pramod Gurav
<pramod.gurav@smartplayin.com> wrote:
> This function releases clk and regulator in remove function for clean
> unloading.
>
> CC: Shawn Guo <shawn.guo@linaro.org>
> CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> ---
>  drivers/cpufreq/cpufreq-cpu0.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

I already have most of this queued up, have sent V3 and cc'd now. See
if you need anything over that.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index 0d2172b..e1574f8 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -229,6 +229,8 @@  static int cpu0_cpufreq_remove(struct platform_device *pdev)
 	cpufreq_cooling_unregister(cdev);
 	cpufreq_unregister_driver(&cpu0_cpufreq_driver);
 	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
+	clk_put(cpu_clk);
+	regulator_put(cpu_reg);
 
 	return 0;
 }