PM / OPP: Don't expose srcu_head to register notifiers

Let the OPP core provide helpers to register notifiers for any device,
instead of exposing srcu_head outside of the core.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Viresh Kumar 2017-01-02 14:41:03 +05:30 committed by Rafael J. Wysocki
parent 3aa26a3b2e
commit dc2c9ad52a
3 changed files with 63 additions and 45 deletions

View file

@ -108,7 +108,9 @@ int dev_pm_opp_enable(struct device *dev, unsigned long freq);
int dev_pm_opp_disable(struct device *dev, unsigned long freq);
struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev);
int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb);
int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb);
int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions,
unsigned int count);
void dev_pm_opp_put_supported_hw(struct device *dev);
@ -202,10 +204,14 @@ static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
return 0;
}
static inline struct srcu_notifier_head *dev_pm_opp_get_notifier(
struct device *dev)
static inline int dev_pm_opp_register_notifier(struct device *dev, struct notifier_block *nb)
{
return ERR_PTR(-ENOTSUPP);
return -ENOTSUPP;
}
static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct notifier_block *nb)
{
return -ENOTSUPP;
}
static inline int dev_pm_opp_set_supported_hw(struct device *dev,