summaryrefslogtreecommitdiffstats
path: root/include/linux/pm_opp.h
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-01-18 03:55:20 +0300
committerViresh Kumar <viresh.kumar@linaro.org>2021-02-02 10:27:30 +0530
commita3c47af6942dc8e07a4328913d0263a965786895 (patch)
tree1c9d0ff43b4c669d3e40882f1444090e84da8eae /include/linux/pm_opp.h
parent559fef0dfd91145b59b7c61061504f344ecf9ad8 (diff)
downloadlinux-a3c47af6942dc8e07a4328913d0263a965786895.tar.bz2
opp: Add devm_pm_opp_register_set_opp_helper
Add resource-managed version of dev_pm_opp_register_set_opp_helper(). Tested-by: Peter Geis <pgwipeout@gmail.com> Tested-by: Nicolas Chauvet <kwizart@gmail.com> Tested-by: Matt Merhar <mattmerhar@protonmail.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> [ Viresh: Manually apply the patch and relocate the routines ] Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'include/linux/pm_opp.h')
-rw-r--r--include/linux/pm_opp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index 158158620dde..473daf34160d 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -152,6 +152,7 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name);
void dev_pm_opp_put_clkname(struct opp_table *opp_table);
struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
+struct opp_table *devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs);
void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
@@ -324,6 +325,13 @@ static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct device
static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) {}
+static inline struct opp_table *
+devm_pm_opp_register_set_opp_helper(struct device *dev,
+ int (*set_opp)(struct dev_pm_set_opp_data *data))
+{
+ return ERR_PTR(-ENOTSUPP);
+}
+
static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)
{
return ERR_PTR(-ENOTSUPP);