PM / Domains: Fix return value of of_genpd_opp_to_performance_state()
[linux-2.6-block.git] / include / linux / pm_domain.h
index 42e0d649e6531577a841cbb7d4b16842a6f413e4..139f79c8477a354ff122da94aaf6fc77ecfd0922 100644 (file)
@@ -237,6 +237,8 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev,
                                struct device_node *opp_node);
 
 int genpd_dev_pm_attach(struct device *dev);
+struct device *genpd_dev_pm_attach_by_id(struct device *dev,
+                                        unsigned int index);
 #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
 static inline int of_genpd_add_provider_simple(struct device_node *np,
                                        struct generic_pm_domain *genpd)
@@ -274,7 +276,7 @@ static inline unsigned int
 of_genpd_opp_to_performance_state(struct device *dev,
                                  struct device_node *opp_node)
 {
-       return -ENODEV;
+       return 0;
 }
 
 static inline int genpd_dev_pm_attach(struct device *dev)
@@ -282,6 +284,12 @@ static inline int genpd_dev_pm_attach(struct device *dev)
        return 0;
 }
 
+static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
+                                                      unsigned int index)
+{
+       return NULL;
+}
+
 static inline
 struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
 {
@@ -291,6 +299,8 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
 
 #ifdef CONFIG_PM
 int dev_pm_domain_attach(struct device *dev, bool power_on);
+struct device *dev_pm_domain_attach_by_id(struct device *dev,
+                                         unsigned int index);
 void dev_pm_domain_detach(struct device *dev, bool power_off);
 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
 #else
@@ -298,6 +308,11 @@ static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
 {
        return 0;
 }
+static inline struct device *dev_pm_domain_attach_by_id(struct device *dev,
+                                                       unsigned int index)
+{
+       return NULL;
+}
 static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {}
 static inline void dev_pm_domain_set(struct device *dev,
                                     struct dev_pm_domain *pd) {}