diff options
| author | Hans de Goede <[email protected]> | 2021-11-22 17:05:31 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2021-12-01 19:14:25 +0000 |
| commit | 1a68b346a2c9969c05e80a3b99a9ab160b5655c0 (patch) | |
| tree | 0bafc7a05471931b7937bb002fd0e98e0641748b /drivers/acpi/bus.c | |
| parent | ACPI / x86: Drop PWM2 device on Lenovo Yoga Book from always present table (diff) | |
| download | kernel-1a68b346a2c9969c05e80a3b99a9ab160b5655c0.tar.gz kernel-1a68b346a2c9969c05e80a3b99a9ab160b5655c0.zip | |
ACPI: Change acpi_device_always_present() into acpi_device_override_status()
Currently, acpi_bus_get_status() calls acpi_device_always_present() to
allow platform quirks to override the _STA return to report that a
device is present (status = ACPI_STA_DEFAULT) independent of the _STA
return.
In some cases it might also be useful to have the opposite functionality
and have a platform quirk which marks a device as not present (status = 0)
to work around ACPI table bugs.
Change acpi_device_always_present() into a more generic
acpi_device_override_status() function to allow this.
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'drivers/acpi/bus.c')
| -rw-r--r-- | drivers/acpi/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index fa923a929224..dd535b4b9a16 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -98,8 +98,8 @@ int acpi_bus_get_status(struct acpi_device *device) acpi_status status; unsigned long long sta; - if (acpi_device_always_present(device)) { - acpi_set_device_status(device, ACPI_STA_DEFAULT); + if (acpi_device_override_status(device, &sta)) { + acpi_set_device_status(device, sta); return 0; } |
