diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-20 07:57:52 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-29 15:20:23 -0400 |
commit | 63a1a765dffb1e59d82c7948638e56d5f4f2e3a1 (patch) | |
tree | acf11bb5436dcca1b9c3f015a8579308cedce028 /drivers/acpi/bus.c | |
parent | b2201e5482bc2376ea5c049442850a260142ac40 (diff) |
ACPI / PM: Fix error messages in drivers/acpi/bus.c
After recent changes of the ACPI device low-power states definitions
kernel messages in drivers/acpi/bus.c need to be updated so that they
include the correct names of the states in question (currently is
"D3" for D3hot and "D4" for D3cold, which is incorrect).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 3188da3df8da..a41be56c1cc0 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -182,6 +182,24 @@ EXPORT_SYMBOL(acpi_bus_get_private_data); | |||
182 | Power Management | 182 | Power Management |
183 | -------------------------------------------------------------------------- */ | 183 | -------------------------------------------------------------------------- */ |
184 | 184 | ||
185 | static const char *state_string(int state) | ||
186 | { | ||
187 | switch (state) { | ||
188 | case ACPI_STATE_D0: | ||
189 | return "D0"; | ||
190 | case ACPI_STATE_D1: | ||
191 | return "D1"; | ||
192 | case ACPI_STATE_D2: | ||
193 | return "D2"; | ||
194 | case ACPI_STATE_D3_HOT: | ||
195 | return "D3hot"; | ||
196 | case ACPI_STATE_D3_COLD: | ||
197 | return "D3"; | ||
198 | default: | ||
199 | return "(unknown)"; | ||
200 | } | ||
201 | } | ||
202 | |||
185 | static int __acpi_bus_get_power(struct acpi_device *device, int *state) | 203 | static int __acpi_bus_get_power(struct acpi_device *device, int *state) |
186 | { | 204 | { |
187 | int result = 0; | 205 | int result = 0; |
@@ -215,8 +233,8 @@ static int __acpi_bus_get_power(struct acpi_device *device, int *state) | |||
215 | device->parent->power.state : ACPI_STATE_D0; | 233 | device->parent->power.state : ACPI_STATE_D0; |
216 | } | 234 | } |
217 | 235 | ||
218 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n", | 236 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is %s\n", |
219 | device->pnp.bus_id, *state)); | 237 | device->pnp.bus_id, state_string(*state))); |
220 | 238 | ||
221 | return 0; | 239 | return 0; |
222 | } | 240 | } |
@@ -234,13 +252,14 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) | |||
234 | /* Make sure this is a valid target state */ | 252 | /* Make sure this is a valid target state */ |
235 | 253 | ||
236 | if (state == device->power.state) { | 254 | if (state == device->power.state) { |
237 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", | 255 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at %s\n", |
238 | state)); | 256 | state_string(state))); |
239 | return 0; | 257 | return 0; |
240 | } | 258 | } |
241 | 259 | ||
242 | if (!device->power.states[state].flags.valid) { | 260 | if (!device->power.states[state].flags.valid) { |
243 | printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); | 261 | printk(KERN_WARNING PREFIX "Device does not support %s\n", |
262 | state_string(state)); | ||
244 | return -ENODEV; | 263 | return -ENODEV; |
245 | } | 264 | } |
246 | if (device->parent && (state < device->parent->power.state)) { | 265 | if (device->parent && (state < device->parent->power.state)) { |
@@ -294,13 +313,13 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) | |||
294 | end: | 313 | end: |
295 | if (result) | 314 | if (result) |
296 | printk(KERN_WARNING PREFIX | 315 | printk(KERN_WARNING PREFIX |
297 | "Device [%s] failed to transition to D%d\n", | 316 | "Device [%s] failed to transition to %s\n", |
298 | device->pnp.bus_id, state); | 317 | device->pnp.bus_id, state_string(state)); |
299 | else { | 318 | else { |
300 | device->power.state = state; | 319 | device->power.state = state; |
301 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 320 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
302 | "Device [%s] transitioned to D%d\n", | 321 | "Device [%s] transitioned to %s\n", |
303 | device->pnp.bus_id, state)); | 322 | device->pnp.bus_id, state_string(state))); |
304 | } | 323 | } |
305 | 324 | ||
306 | return result; | 325 | return result; |