]> git.baikalelectronics.ru Git - kernel.git/commit
PM / OPP: Return opp_table from dev_pm_opp_set_*() routines
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Jan 2017 04:41:43 +0000 (10:11 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 Jan 2017 08:22:21 +0000 (09:22 +0100)
commit864183b2d3bbcab68462a27e046bdd476e6b980f
tree1f336b6e9ec46282ea3967775ced17b3533fa55f
parent231d73fdb72825fa36aff55d0d37e6499d309892
PM / OPP: Return opp_table from dev_pm_opp_set_*() routines

Now that we have proper kernel reference infrastructure in place for OPP
tables, use it to guarantee that the OPP table isn't freed while being
used by the callers of dev_pm_opp_set_*() APIs.

Make them all return the pointer to the OPP table after taking its
reference and put the reference back with dev_pm_opp_put_*() APIs.

Now that the OPP table wouldn't get freed while these routines are
executing after dev_pm_opp_get_opp_table() is called, there is no need
to take opp_table_lock. Drop them as well.

Remove the rcu specific comments from these routines as they aren't
relevant anymore.

Note that prototypes of dev_pm_opp_{set|put}_regulators() were already
updated by another patch.

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/cpufreq/sti-cpufreq.c
include/linux/pm_opp.h