ACPI / PM: Add function for device power state initialization
Add function acpi_bus_init_power() for getting the initial power state of an ACPI device and reference counting its power resources as appropriate. Make acpi_bus_get_power_flags() use the new function instead of acpi_bus_get_power() that updates device->power.state without reference counting the device's power resources. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
committed by
Len Brown
parent
5e6d4fe429
commit
ade3e7fef7
@ -901,10 +901,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
|
||||
device->power.states[ACPI_STATE_D3].flags.valid = 1;
|
||||
device->power.states[ACPI_STATE_D3].power = 0;
|
||||
|
||||
/* TBD: System wake support and resource requirements. */
|
||||
|
||||
device->power.state = ACPI_STATE_UNKNOWN;
|
||||
acpi_bus_get_power(device->handle, &(device->power.state));
|
||||
acpi_bus_init_power(device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user