|
@@ -423,19 +423,16 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev)
|
|
|
Device Power Management
|
|
|
-------------------------------------------------------------------------- */
|
|
|
|
|
|
-int acpi_power_get_inferred_state(struct acpi_device *device)
|
|
|
+int acpi_power_get_inferred_state(struct acpi_device *device, int *state)
|
|
|
{
|
|
|
int result = 0;
|
|
|
struct acpi_handle_list *list = NULL;
|
|
|
int list_state = 0;
|
|
|
int i = 0;
|
|
|
|
|
|
-
|
|
|
- if (!device)
|
|
|
+ if (!device || !state)
|
|
|
return -EINVAL;
|
|
|
|
|
|
- device->power.state = ACPI_STATE_UNKNOWN;
|
|
|
-
|
|
|
/*
|
|
|
* We know a device's inferred power state when all the resources
|
|
|
* required for a given D-state are 'on'.
|
|
@@ -450,13 +447,12 @@ int acpi_power_get_inferred_state(struct acpi_device *device)
|
|
|
return result;
|
|
|
|
|
|
if (list_state == ACPI_POWER_RESOURCE_STATE_ON) {
|
|
|
- device->power.state = i;
|
|
|
+ *state = i;
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- device->power.state = ACPI_STATE_D3;
|
|
|
-
|
|
|
+ *state = ACPI_STATE_D3;
|
|
|
return 0;
|
|
|
}
|
|
|
|