summaryrefslogtreecommitdiff
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
commitad0c3b0e4863185a9f8874a655a8d2999c915131 (patch)
tree972f8b80fe2890c393f8862f969ac0a4db704f7a /drivers/acpi/bus.c
parentff0c41942fd9766a158502d8ed6965c8a7726f53 (diff)
downloadlwn-ad0c3b0e4863185a9f8874a655a8d2999c915131.tar.gz
lwn-ad0c3b0e4863185a9f8874a655a8d2999c915131.zip
ACPI / PM: More visible function for retrieving device power states
The function used for retrieving ACPI device power states, __acpi_bus_get_power(), 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_device_get_power(), in analogy with acpi_device_set_power(), 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.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 8e57fc49726e..0e1441cc4d7f 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -200,7 +200,16 @@ static const char *state_string(int state)
}
}
-static int __acpi_bus_get_power(struct acpi_device *device, int *state)
+/**
+ * acpi_device_get_power - Get power state of an ACPI device.
+ * @device: Device to get the power state of.
+ * @state: Place to store the power state of the device.
+ *
+ * This function does not update the device's power.state field, but it may
+ * update its parent's power.state field (when the parent's power state is
+ * unknown and the device's power state turns out to be D0).
+ */
+int acpi_device_get_power(struct acpi_device *device, int *state)
{
int result = ACPI_STATE_UNKNOWN;
@@ -397,7 +406,7 @@ int acpi_bus_init_power(struct acpi_device *device)
device->power.state = ACPI_STATE_UNKNOWN;
- result = __acpi_bus_get_power(device, &state);
+ result = acpi_device_get_power(device, &state);
if (result)
return result;
@@ -421,7 +430,7 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p)
if (result)
return result;
- result = __acpi_bus_get_power(device, &state);
+ result = acpi_device_get_power(device, &state);
if (result)
return result;