PM / Domains: Save OPP table pointer in genpd
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 2 Nov 2018 05:48:08 +0000 (11:18 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 14 Dec 2018 10:58:14 +0000 (16:28 +0530)
commit1067ae3e427fba60965fc519e20d54d0b210fd27
tree1f55911d73f9ee3f8372d7ce9dcf166f65ee3d8d
parent2feb5a896c42fb24f6d6f7028574dc59bfc9306f
PM / Domains: Save OPP table pointer in genpd

dev_pm_genpd_set_performance_state() will be required to call
dev_pm_opp_xlate_performance_state() going forward to translate from
performance state of a sub-domain to performance state of its master.
And dev_pm_opp_xlate_performance_state() needs pointers to the OPP
tables of both genpd and its master.

Lets fetch and save them while the OPP tables are added. Fetching the
OPP tables should never fail as we just added the OPP tables and so add
a WARN_ON() for such a bug instead of full error paths.

Tested-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/base/power/domain.c
include/linux/pm_domain.h