From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/8] cpufreq-dt: free OPP table created during ->init()
Date: Tue, 25 Nov 2014 16:04:21 +0530 [thread overview]
Message-ID: <1ac3e8c67c7bd2a962aed6561693d16ca5cd9db9.1416910766.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1416910766.git.viresh.kumar@linaro.org>
OPP layer now supports freeing of OPPs and we should free them once they aren't
useful anymore.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq-dt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 8cba13d..f44419c 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -215,7 +215,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
ret = -ENOMEM;
- goto out_put_node;
+ goto out_free_opp;
}
of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance);
@@ -310,7 +310,8 @@ static int cpufreq_init(struct cpufreq_policy *policy)
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
out_free_priv:
kfree(priv);
-out_put_node:
+out_free_opp:
+ of_free_opp_table(cpu_dev);
of_node_put(np);
out_put_reg_clk:
clk_put(cpu_clk);
@@ -326,6 +327,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy)
cpufreq_cooling_unregister(priv->cdev);
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
+ of_free_opp_table(priv->cpu_dev);
clk_put(policy->clk);
if (!IS_ERR(priv->cpu_reg))
regulator_put(priv->cpu_reg);
--
2.0.3.693.g996b0fd
next prev parent reply other threads:[~2014-11-25 10:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 10:34 [PATCH 0/8] OPP: Remove OPPs when not in use Viresh Kumar
2014-11-25 10:34 ` [PATCH 1/8] opp: rename 'head' as 'rcu_head' or 'srcu_head' based on its type Viresh Kumar
2014-11-25 10:34 ` [PATCH 2/8] opp: don't match for existing OPPs when list is empty Viresh Kumar
2014-11-25 10:34 ` [PATCH 3/8] opp: mark OPPs as 'static' or 'dynamic' Viresh Kumar
2014-11-25 10:34 ` [PATCH 4/8] opp: Introduce APIs to remove OPPs Viresh Kumar
2014-11-25 16:24 ` Paul E. McKenney
2014-11-25 17:16 ` Viresh Kumar
2014-11-25 17:39 ` Paul E. McKenney
2014-11-26 6:29 ` Viresh Kumar
2014-11-26 9:17 ` Viresh Kumar
2014-11-26 22:32 ` Rafael J. Wysocki
2014-11-27 0:26 ` Viresh Kumar
2014-11-27 0:48 ` Rafael J. Wysocki
2014-11-27 3:24 ` [PATCH V2 " Viresh Kumar
2014-11-27 3:24 ` [PATCH V1 5/8] opp: replace kfree_rcu() with call_srcu() in opp_set_availability() Viresh Kumar
2014-12-01 23:25 ` [PATCH V2 4/8] opp: Introduce APIs to remove OPPs Paul E. McKenney
2014-11-25 10:34 ` [PATCH 5/8] arm_big_little: free OPP table created during ->init() Viresh Kumar
2014-12-01 7:11 ` Viresh Kumar
2014-12-01 22:37 ` Rafael J. Wysocki
2014-12-02 3:46 ` Viresh Kumar
2014-11-25 10:34 ` Viresh Kumar [this message]
2014-11-25 20:15 ` [PATCH 6/8] cpufreq-dt: " Stefan Wahren
2014-11-25 10:34 ` [PATCH 7/8] exynos5440: " Viresh Kumar
2014-11-25 10:34 ` [PATCH 8/8] imx6q: " 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=1ac3e8c67c7bd2a962aed6561693d16ca5cd9db9.1416910766.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).