summaryrefslogtreecommitdiff
path: root/drivers/base/power/opp/of.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-01-02 12:10:59 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-01-27 13:49:09 +0300
commit969fceb3c7e6fc7fd0419b0392435717824f7ba5 (patch)
tree1c41a350a190b4997553e98ea0e5a98a343e0241 /drivers/base/power/opp/of.c
parent04a86a84c42ca18f37ab446127dc619b41dd3b23 (diff)
downloadlinux-969fceb3c7e6fc7fd0419b0392435717824f7ba5.tar.xz
PM / OPP: Add light weight _opp_free() routine
The OPPs which are never successfully added using _opp_add() are not required to be freed with the _opp_remove() routine, as a simple kfree() is enough for them. Introduce a new light weight routine _opp_free(), which will do that. That also helps us removing the 'notify' parameter to _opp_remove(), which isn't required anymore. Note that _opp_free() contains a call to _remove_opp_table() as the OPP table might have been added for this very OPP only. The _remove_opp_table() routine returns quickly if there are more OPPs in the table. This will be simplified in later patches though. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power/opp/of.c')
-rw-r--r--drivers/base/power/opp/of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c
index c8fe815774ff..67c9eeded4e1 100644
--- a/drivers/base/power/opp/of.c
+++ b/drivers/base/power/opp/of.c
@@ -362,7 +362,7 @@ static int _opp_add_static_v2(struct device *dev, struct device_node *np)
return 0;
free_opp:
- _opp_remove(opp_table, new_opp, false);
+ _opp_free(new_opp, opp_table);
unlock:
mutex_unlock(&opp_table_lock);
return ret;