summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-17 14:11:08 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-17 14:11:08 +0100
commit96bfd3cee2a741906b3ef5c1096d2f0a0b8025e0 (patch)
tree9efdfad1f1206821057931f0fb67313eada8727d /drivers/acpi/bus.c
parentad0c3b0e4863185a9f8874a655a8d2999c915131 (diff)
downloadop-kernel-dev-96bfd3cee2a741906b3ef5c1096d2f0a0b8025e0.zip
op-kernel-dev-96bfd3cee2a741906b3ef5c1096d2f0a0b8025e0.tar.gz
ACPI / PM: Common string representations of device power states
The function returning string representations of ACPI device power states, state_string((), is now static, because it is only used internally in drivers/acpi/bus.c. However, it will be used outside of that file going forward, so rename it to acpi_power_state_string(), add a kerneldoc comment to it and add its header to acpi_bus.h. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 0e1441c..6c9b16c 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -182,7 +182,11 @@ EXPORT_SYMBOL(acpi_bus_get_private_data);
Power Management
-------------------------------------------------------------------------- */
-static const char *state_string(int state)
+/**
+ * acpi_power_state_string - String representation of ACPI device power state.
+ * @state: ACPI device power state to return the string representation of.
+ */
+const char *acpi_power_state_string(int state)
{
switch (state) {
case ACPI_STATE_D0:
@@ -260,7 +264,7 @@ int acpi_device_get_power(struct acpi_device *device, int *state)
out:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is %s\n",
- device->pnp.bus_id, state_string(*state)));
+ device->pnp.bus_id, acpi_power_state_string(*state)));
return 0;
}
@@ -288,13 +292,13 @@ int acpi_device_set_power(struct acpi_device *device, int state)
if (state == device->power.state) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at %s\n",
- state_string(state)));
+ acpi_power_state_string(state)));
return 0;
}
if (!device->power.states[state].flags.valid) {
printk(KERN_WARNING PREFIX "Device does not support %s\n",
- state_string(state));
+ acpi_power_state_string(state));
return -ENODEV;
}
if (device->parent && (state < device->parent->power.state)) {
@@ -362,12 +366,14 @@ int acpi_device_set_power(struct acpi_device *device, int state)
if (result)
printk(KERN_WARNING PREFIX
"Device [%s] failed to transition to %s\n",
- device->pnp.bus_id, state_string(state));
+ device->pnp.bus_id,
+ acpi_power_state_string(state));
else {
device->power.state = state;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Device [%s] transitioned to %s\n",
- device->pnp.bus_id, state_string(state)));
+ device->pnp.bus_id,
+ acpi_power_state_string(state)));
}
return result;
OpenPOWER on IntegriCloud