summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-01-14 00:39:36 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2012-01-14 00:39:36 +0100
commite59a8db8d9b7c02e0bbefbeb18a3836288a97b8a (patch)
tree6d507257fb36ecccdaed806869934419ae890506 /drivers/base
parent0f1d6986bae57b6d11e2c9ce5e66b6c6b0e3684d (diff)
PM / Domains: Skip governor functions for CONFIG_PM_RUNTIME unset
The governor functions in drivers/base/power/domain_governor.c are only used if CONFIG_PM_RUNTIME is set and they refer to data structures that are only present in that case. For this reason, they shouldn't be compiled at all when CONFIG_PM_RUNTIME is not set. Reported-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain_governor.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
index 51527ee92d1..66a265bf586 100644
--- a/drivers/base/power/domain_governor.c
+++ b/drivers/base/power/domain_governor.c
@@ -12,6 +12,8 @@
#include <linux/pm_qos.h>
#include <linux/hrtimer.h>
+#ifdef CONFIG_PM_RUNTIME
+
/**
* default_stop_ok - Default PM domain governor routine for stopping devices.
* @dev: Device to check.
@@ -137,16 +139,28 @@ static bool default_power_down_ok(struct dev_pm_domain *pd)
return true;
}
-struct dev_power_governor simple_qos_governor = {
- .stop_ok = default_stop_ok,
- .power_down_ok = default_power_down_ok,
-};
-
static bool always_on_power_down_ok(struct dev_pm_domain *domain)
{
return false;
}
+#else /* !CONFIG_PM_RUNTIME */
+
+bool default_stop_ok(struct device *dev)
+{
+ return false;
+}
+
+#define default_power_down_ok NULL
+#define always_on_power_down_ok NULL
+
+#endif /* !CONFIG_PM_RUNTIME */
+
+struct dev_power_governor simple_qos_governor = {
+ .stop_ok = default_stop_ok,
+ .power_down_ok = default_power_down_ok,
+};
+
/**
* pm_genpd_gov_always_on - A governor implementing an always-on policy
*/