diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2020-11-06 10:37:16 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2020-12-09 11:21:11 +0530 |
commit | e77dcb0b732dd355ca594909f6c2085dfc46cde2 (patch) | |
tree | ba370ea1f448bac7300afab5a0ff48fa91c057d5 /drivers/opp/opp.h | |
parent | 873c9851eb54b78c27a0d753f6dd7e377572a0aa (diff) | |
download | lwn-e77dcb0b732dd355ca594909f6c2085dfc46cde2.tar.gz lwn-e77dcb0b732dd355ca594909f6c2085dfc46cde2.zip |
opp: Don't create an OPP table from dev_pm_opp_get_opp_table()
It has been found that some users (like cpufreq-dt and others on LKML)
have abused the helper dev_pm_opp_get_opp_table() to create the OPP
table instead of just finding it, which is the wrong thing to do. This
routine was meant for OPP core's internal working and exposed the whole
functionality by mistake.
Change the scope of dev_pm_opp_get_opp_table() to only finding the
table. The internal helpers _opp_get_opp_table*() are thus renamed to
_add_opp_table*(), dev_pm_opp_get_opp_table_indexed() is removed (as we
don't need the index field for finding the OPP table) and so the only
user, genpd, is updated.
Note that the prototype of _add_opp_table() was already left in opp.h by
mistake when it was removed earlier and so we weren't required to add it
now.
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp/opp.h')
-rw-r--r-- | drivers/opp/opp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h index ebd930e0b3ca..4ced7ffa8158 100644 --- a/drivers/opp/opp.h +++ b/drivers/opp/opp.h @@ -224,6 +224,7 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, struct opp_table *o int _opp_add_v1(struct opp_table *opp_table, struct device *dev, unsigned long freq, long u_volt, bool dynamic); void _dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask, int last_cpu); struct opp_table *_add_opp_table(struct device *dev); +struct opp_table *_add_opp_table_indexed(struct device *dev, int index); void _put_opp_list_kref(struct opp_table *opp_table); #ifdef CONFIG_OF |