From 15cc9cd1513f1707e957593cf11eb4ba2f2af11f Mon Sep 17 00:00:00 2001 From: Lukasz Luba Date: Wed, 23 Jan 2019 19:14:41 +0100 Subject: [PATCH] include: pm_opp: define new function devm_pm_opp_add() Add new function declaration devm_pm_opp_add() in OPP PM subsystem. It provides safe mechanism for registering OPPs in case of deffer probe. The patch adds also inline empty functions in case of lack the config. There is also declaration for devm_pm_opp_remove functions. Change-Id: I03f14038b03f51fab2674f1cce5df78af37105c2 Signed-off-by: Lukasz Luba --- include/linux/pm_opp.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 51ec727b4824..5773fdb5d707 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -106,7 +106,10 @@ void dev_pm_opp_put(struct dev_pm_opp *opp); int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt); +int devm_pm_opp_add(struct device *dev, unsigned long freq, + unsigned long u_volt); void dev_pm_opp_remove(struct device *dev, unsigned long freq); +void devm_pm_opp_remove(struct device *dev, unsigned long freq); int dev_pm_opp_enable(struct device *dev, unsigned long freq); @@ -204,10 +207,20 @@ static inline int dev_pm_opp_add(struct device *dev, unsigned long freq, return -ENOTSUPP; } +static inline int devm_pm_opp_add(struct device *dev, unsigned long freq, + unsigned long u_volt) +{ + return -ENOTSUPP; +} + static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq) { } +static inline void devm_pm_opp_remove(struct device *dev, unsigned long freq) +{ +} + static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq) { return 0; -- 2.34.1