summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 23:13:13 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 23:13:13 +0200
commit42a09284fab8abc15c8554f2e2aa2368161c77c6 (patch)
tree45c9b33c1e7667628baad14f30eeba540680a8c8 /include
parentcd0c5bd391c45ace8527c105b79017149e695f85 (diff)
parent6392bfd57654338f0df8346dd058e91b8215ab11 (diff)
Merge branch 'pm-devfreq'
* pm-devfreq: PM / devfreq: remove checks for CONFIG_EXYNOS_ASV PM / devfreq: exynos5: Use devm_devfreq_* function using device resource management PM / devfreq: exynos4: Use devm_devfreq_* function using device resource management PM / devfreq: Add devm_devfreq_{register,unregister}_opp_notfier function PM / devfreq: Add resource-managed function for devfreq device PM / devfreq: Fix devfreq_remove_device() to improve the sequence of resource free PM / devfreq: exynos: make more PPMU code common PM / devfreq: exynos5: introduce struct busfreq_ppmu_data PM / devfreq: exynos4: introduce struct busfreq_ppmu_data PM / devfreq: exynos4: use common PPMU code PM / devfreq: exynos5: Add CONFIG_PM_OPP dependency to fix probe fail PM / devfreq: exynos5: Use SIMPLE_DEV_PM_OPS macro PM / devfreq: exynos4: Add CONFIG_PM_OPP dependency to fix probe fail PM / devfreq: exynos4: Use SIMPLE_DEV_PM_OPS macro PM / devfreq: exynos4: Fix bug of resource leak and code clean on probe()
Diffstat (limited to 'include')
-rw-r--r--include/linux/devfreq.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index d48dc00232a4..f1863dcd83ea 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -181,6 +181,12 @@ extern struct devfreq *devfreq_add_device(struct device *dev,
const char *governor_name,
void *data);
extern int devfreq_remove_device(struct devfreq *devfreq);
+extern struct devfreq *devm_devfreq_add_device(struct device *dev,
+ struct devfreq_dev_profile *profile,
+ const char *governor_name,
+ void *data);
+extern void devm_devfreq_remove_device(struct device *dev,
+ struct devfreq *devfreq);
/* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */
extern int devfreq_suspend_device(struct devfreq *devfreq);
@@ -193,6 +199,10 @@ extern int devfreq_register_opp_notifier(struct device *dev,
struct devfreq *devfreq);
extern int devfreq_unregister_opp_notifier(struct device *dev,
struct devfreq *devfreq);
+extern int devm_devfreq_register_opp_notifier(struct device *dev,
+ struct devfreq *devfreq);
+extern void devm_devfreq_unregister_opp_notifier(struct device *dev,
+ struct devfreq *devfreq);
#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
/**
@@ -220,7 +230,7 @@ static inline struct devfreq *devfreq_add_device(struct device *dev,
const char *governor_name,
void *data)
{
- return NULL;
+ return ERR_PTR(-ENOSYS);
}
static inline int devfreq_remove_device(struct devfreq *devfreq)
@@ -228,6 +238,19 @@ static inline int devfreq_remove_device(struct devfreq *devfreq)
return 0;
}
+static inline struct devfreq *devm_devfreq_add_device(struct device *dev,
+ struct devfreq_dev_profile *profile,
+ const char *governor_name,
+ void *data)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+static inline void devm_devfreq_remove_device(struct device *dev,
+ struct devfreq *devfreq)
+{
+}
+
static inline int devfreq_suspend_device(struct devfreq *devfreq)
{
return 0;
@@ -256,6 +279,16 @@ static inline int devfreq_unregister_opp_notifier(struct device *dev,
return -EINVAL;
}
+static inline int devm_devfreq_register_opp_notifier(struct device *dev,
+ struct devfreq *devfreq)
+{
+ return -EINVAL;
+}
+
+static inline void devm_devfreq_unregister_opp_notifier(struct device *dev,
+ struct devfreq *devfreq)
+{
+}
#endif /* CONFIG_PM_DEVFREQ */
#endif /* __LINUX_DEVFREQ_H__ */