Lines 807-812
int acpi_power_get_inferred_state(struct acpi_device *device, int *state)
Link Here
|
807 |
if (!device || !state) |
807 |
if (!device || !state) |
808 |
return -EINVAL; |
808 |
return -EINVAL; |
809 |
|
809 |
|
|
|
810 |
/* |
811 |
* Some devices do not have a power-resource-list for D0, but do |
812 |
* have a power-resource-lists for e.g. D3 so we do end up here. |
813 |
* In this case we can never infer that the device is in D0 even |
814 |
* though it might very well be in D0, so return ACPI_STATE_UNKNOWN. |
815 |
*/ |
816 |
if (list_empty(&device->power.states[ACPI_STATE_D0].resources)) { |
817 |
*state = ACPI_STATE_UNKNOWN; |
818 |
return 0; |
819 |
} |
820 |
|
810 |
/* |
821 |
/* |
811 |
* We know a device's inferred power state when all the resources |
822 |
* We know a device's inferred power state when all the resources |
812 |
* required for a given D-state are 'on'. |
823 |
* required for a given D-state are 'on'. |
813 |
- |
|
|