From: Eduardo Valentin <edubezval@gmail.com> To: Linux PM <linux-pm@vger.kernel.org>, Viresh Kumar <viresh.kumar@linaro.org> Cc: Eduardo Valentin <edubezval@gmail.com>, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Kukjin Kim <kgene@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/14] cpufreq: exynos4x12: use devm_clk_get Date: Mon, 2 Feb 2015 16:58:09 -0400 [thread overview] Message-ID: <1422910697-5920-7-git-send-email-edubezval@gmail.com> (raw) In-Reply-To: <1422910697-5920-1-git-send-email-edubezval@gmail.com> Switch to managed clk_get to properly release resources when they are not needed. Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Kukjin Kim <kgene@kernel.org> Cc: linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> --- drivers/cpufreq/exynos4x12-cpufreq.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c index 3da36baf..7e0dd2a 100644 --- a/drivers/cpufreq/exynos4x12-cpufreq.c +++ b/drivers/cpufreq/exynos4x12-cpufreq.c @@ -189,23 +189,23 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) return -EFAULT; } - cpu_clk = clk_get(NULL, "armclk"); + cpu_clk = devm_clk_get(info->dev, "armclk"); if (IS_ERR(cpu_clk)) - return PTR_ERR(cpu_clk); + goto err; - moutcore = clk_get(NULL, "moutcore"); + moutcore = devm_clk_get(info->dev, "moutcore"); if (IS_ERR(moutcore)) - goto err_moutcore; + goto err; - mout_mpll = clk_get(NULL, "mout_mpll"); + mout_mpll = devm_clk_get(info->dev, "mout_mpll"); if (IS_ERR(mout_mpll)) - goto err_mout_mpll; + goto err; rate = clk_get_rate(mout_mpll) / 1000; - mout_apll = clk_get(NULL, "mout_apll"); + mout_apll = devm_clk_get(info->dev, "mout_apll"); if (IS_ERR(mout_apll)) - goto err_mout_apll; + goto err; if (info->type == EXYNOS_SOC_4212) apll_freq_4x12 = apll_freq_4212; @@ -225,13 +225,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) return 0; -err_mout_apll: - clk_put(mout_mpll); -err_mout_mpll: - clk_put(moutcore); -err_moutcore: - clk_put(cpu_clk); - +err: iounmap(info->cmu_regs); of_node_put(np); pr_debug("%s: failed initialization\n", __func__); -- 2.1.3
WARNING: multiple messages have this Message-ID (diff)
From: edubezval@gmail.com (Eduardo Valentin) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/14] cpufreq: exynos4x12: use devm_clk_get Date: Mon, 2 Feb 2015 16:58:09 -0400 [thread overview] Message-ID: <1422910697-5920-7-git-send-email-edubezval@gmail.com> (raw) In-Reply-To: <1422910697-5920-1-git-send-email-edubezval@gmail.com> Switch to managed clk_get to properly release resources when they are not needed. Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Kukjin Kim <kgene@kernel.org> Cc: linux-pm at vger.kernel.org Cc: linux-arm-kernel at lists.infradead.org Cc: linux-samsung-soc at vger.kernel.org Cc: linux-kernel at vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> --- drivers/cpufreq/exynos4x12-cpufreq.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c index 3da36baf..7e0dd2a 100644 --- a/drivers/cpufreq/exynos4x12-cpufreq.c +++ b/drivers/cpufreq/exynos4x12-cpufreq.c @@ -189,23 +189,23 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) return -EFAULT; } - cpu_clk = clk_get(NULL, "armclk"); + cpu_clk = devm_clk_get(info->dev, "armclk"); if (IS_ERR(cpu_clk)) - return PTR_ERR(cpu_clk); + goto err; - moutcore = clk_get(NULL, "moutcore"); + moutcore = devm_clk_get(info->dev, "moutcore"); if (IS_ERR(moutcore)) - goto err_moutcore; + goto err; - mout_mpll = clk_get(NULL, "mout_mpll"); + mout_mpll = devm_clk_get(info->dev, "mout_mpll"); if (IS_ERR(mout_mpll)) - goto err_mout_mpll; + goto err; rate = clk_get_rate(mout_mpll) / 1000; - mout_apll = clk_get(NULL, "mout_apll"); + mout_apll = devm_clk_get(info->dev, "mout_apll"); if (IS_ERR(mout_apll)) - goto err_mout_apll; + goto err; if (info->type == EXYNOS_SOC_4212) apll_freq_4x12 = apll_freq_4212; @@ -225,13 +225,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info) return 0; -err_mout_apll: - clk_put(mout_mpll); -err_mout_mpll: - clk_put(moutcore); -err_moutcore: - clk_put(cpu_clk); - +err: iounmap(info->cmu_regs); of_node_put(np); pr_debug("%s: failed initialization\n", __func__); -- 2.1.3
next prev parent reply other threads:[~2015-02-02 20:59 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-02-02 20:58 [PATCH 00/14] cpufreq: resource management in preparation for module build Eduardo Valentin 2015-02-02 20:58 ` [PATCH 01/14] cpufreq: exynos4210: properly put of node Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 02/14] cpufreq: exynos4210: iounmap in error path Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 03/14] cpufreq: exynos4210: use devm_clk_get Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 04/14] cpufreq: exynos4x12: properly put of node Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 05/14] cpufreq: exynos4x12: iounmap in error path Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin [this message] 2015-02-02 20:58 ` [PATCH 06/14] cpufreq: exynos4x12: use devm_clk_get Eduardo Valentin 2015-02-02 20:58 ` [PATCH 07/14] cpufreq: exynos5250: properly put of node Eduardo Valentin 2015-02-02 20:58 ` [PATCH 08/14] cpufreq: exynos5250: iounmap in error path Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 09/14] cpufreq: exynos5250: use devm_clk_get Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 10/14] cpufreq: exynox-cpufreq: pass exynos_dvfs_info to .set_freq callback Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 11/14] cpufreq: exynos4210: remove unused symbol cpufreq Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 12/14] cpufreq: exynos4x12: " Eduardo Valentin 2015-02-02 20:58 ` [PATCH 13/14] cpufreq: exynos5250: " Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 20:58 ` [PATCH 14/14] cpufreq: exynos-cpufreq: release resources by using managed allocation Eduardo Valentin 2015-02-02 20:58 ` Eduardo Valentin 2015-02-02 22:54 ` [PATCH 00/14] cpufreq: resource management in preparation for module build Rafael J. Wysocki 2015-02-03 4:05 ` Viresh Kumar 2015-02-03 19:31 ` Eduardo Valentin 2015-02-04 4:58 ` Viresh Kumar 2015-02-04 8:52 ` Lukasz Majewski 2015-02-04 9:56 ` Viresh Kumar
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1422910697-5920-7-git-send-email-edubezval@gmail.com \ --to=edubezval@gmail.com \ --cc=kgene@kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=rjw@rjwysocki.net \ --cc=viresh.kumar@linaro.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.