PM / OPP: Add light weight _opp_free() routine
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 2 Jan 2017 09:10:59 +0000 (14:40 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Jan 2017 10:49:09 +0000 (11:49 +0100)
commit969fceb3c7e6fc7fd0419b0392435717824f7ba5
tree1c41a350a190b4997553e98ea0e5a98a343e0241
parent04a86a84c42ca18f37ab446127dc619b41dd3b23
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>
drivers/base/power/opp/core.c
drivers/base/power/opp/of.c
drivers/base/power/opp/opp.h