include: pm_opp: define new function devm_pm_opp_add()
authorLukasz Luba <l.luba@partner.samsung.com>
Wed, 23 Jan 2019 18:14:41 +0000 (19:14 +0100)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:58:21 +0000 (14:58 +0900)
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 <l.luba@partner.samsung.com>
include/linux/pm_opp.h

index 51ec727..5773fdb 100644 (file)
@@ -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;