]> git.baikalelectronics.ru Git - kernel.git/commit
PM / OPP: Take kref from _find_opp_table()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 23 Jan 2017 04:41:48 +0000 (10:11 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 Jan 2017 08:22:22 +0000 (09:22 +0100)
commitad801d06db660c4db775acb27f026a3bf9a65a9c
tree93ae6faaad201381793f8322b6d9c227e2c489b0
parent8e3499a4e4f4f15d1e43e327c1493e3c6c9f5402
PM / OPP: Take kref from _find_opp_table()

Take reference of the OPP table from within _find_opp_table(). Also
update the callers of _find_opp_table() to call
dev_pm_opp_put_opp_table() after they have used the OPP table.

Note that _find_opp_table() increments the reference under the
opp_table_lock.

Now that the OPP table wouldn't get freed until the callers of
_find_opp_table() call dev_pm_opp_put_opp_table(), there is no need to
take the opp_table_lock or rcu_read_lock() around it. Drop them.

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/cpu.c