diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-01-13 18:39:36 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-01-13 18:39:36 -0500 |
commit | e59a8db8d9b7c02e0bbefbeb18a3836288a97b8a (patch) | |
tree | 6d507257fb36ecccdaed806869934419ae890506 /drivers/base | |
parent | 0f1d6986bae57b6d11e2c9ce5e66b6c6b0e3684d (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.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c index 51527ee92d10..66a265bf5867 100644 --- a/drivers/base/power/domain_governor.c +++ b/drivers/base/power/domain_governor.c | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/pm_qos.h> | 12 | #include <linux/pm_qos.h> |
13 | #include <linux/hrtimer.h> | 13 | #include <linux/hrtimer.h> |
14 | 14 | ||
15 | #ifdef CONFIG_PM_RUNTIME | ||
16 | |||
15 | /** | 17 | /** |
16 | * default_stop_ok - Default PM domain governor routine for stopping devices. | 18 | * default_stop_ok - Default PM domain governor routine for stopping devices. |
17 | * @dev: Device to check. | 19 | * @dev: Device to check. |
@@ -137,16 +139,28 @@ static bool default_power_down_ok(struct dev_pm_domain *pd) | |||
137 | return true; | 139 | return true; |
138 | } | 140 | } |
139 | 141 | ||
140 | struct dev_power_governor simple_qos_governor = { | ||
141 | .stop_ok = default_stop_ok, | ||
142 | .power_down_ok = default_power_down_ok, | ||
143 | }; | ||
144 | |||
145 | static bool always_on_power_down_ok(struct dev_pm_domain *domain) | 142 | static bool always_on_power_down_ok(struct dev_pm_domain *domain) |
146 | { | 143 | { |
147 | return false; | 144 | return false; |
148 | } | 145 | } |
149 | 146 | ||
147 | #else /* !CONFIG_PM_RUNTIME */ | ||
148 | |||
149 | bool default_stop_ok(struct device *dev) | ||
150 | { | ||
151 | return false; | ||
152 | } | ||
153 | |||
154 | #define default_power_down_ok NULL | ||
155 | #define always_on_power_down_ok NULL | ||
156 | |||
157 | #endif /* !CONFIG_PM_RUNTIME */ | ||
158 | |||
159 | struct dev_power_governor simple_qos_governor = { | ||
160 | .stop_ok = default_stop_ok, | ||
161 | .power_down_ok = default_power_down_ok, | ||
162 | }; | ||
163 | |||
150 | /** | 164 | /** |
151 | * pm_genpd_gov_always_on - A governor implementing an always-on policy | 165 | * pm_genpd_gov_always_on - A governor implementing an always-on policy |
152 | */ | 166 | */ |