cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP table
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 6 Nov 2020 04:58:43 +0000 (10:28 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Wed, 9 Dec 2020 05:51:11 +0000 (11:21 +0530)
commit873c9851eb54b78c27a0d753f6dd7e377572a0aa
treeffa2d33b3ef5da8eb3e65d9ef0b2e0f6869c0fd3
parentcf1fac943c6341dfed1db1293864c9fcad47bac3
cpufreq: dt: Don't (ab)use dev_pm_opp_get_opp_table() to create OPP table

Initially, the helper dev_pm_opp_get_opp_table() was supposed to be used
only for the OPP core's internal use (it tries to find an existing OPP
table and if it doesn't find one, then it allocates the OPP table).

Sometime back, the cpufreq-dt driver started using it to make sure all
the relevant resources required by the OPP core are available earlier
during initialization process to properly propagate -EPROBE_DEFER.

It worked but it also abused the API to create an OPP table, which
should be created with the help of other helpers provided by the OPP
core.

The OPP core will be updated in a later commit to limit the scope of
dev_pm_opp_get_opp_table() to only finding an existing OPP table and not
create one. This commit updates the cpufreq-dt driver before that
happens.

Now the cpufreq-dt driver creates the OPP and cpufreq tables for all the
CPUs from driver's init callback itself.

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq-dt.c