diff options
| author | Barnabás Pőcze <[email protected]> | 2021-09-04 17:56:29 +0000 |
|---|---|---|
| committer | Hans de Goede <[email protected]> | 2021-09-14 10:26:02 +0000 |
| commit | 736b48aae5e83b5fab16fc9f31354d2cf863aa79 (patch) | |
| tree | f11a4e7c1543a07586442f991d1b0c4bc121e9ce /drivers/platform/x86/wmi.c | |
| parent | platform/x86: wmi: do not fail if disabling fails (diff) | |
| download | kernel-736b48aae5e83b5fab16fc9f31354d2cf863aa79.tar.gz kernel-736b48aae5e83b5fab16fc9f31354d2cf863aa79.zip | |
platform/x86: wmi: simplify error handling logic
The current code carries out the following ACPI status
mapping:
AE_NOT_FOUND -> AE_OK
AE_OK -> AE_OK
AE_$X -> AE_$X
That is, everything is mapped to itself, except AE_NOT_FOUND.
The current code does not do it in the most straighforward way.
Simplify the logic.
Signed-off-by: Barnabás Pőcze <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Diffstat (limited to 'drivers/platform/x86/wmi.c')
| -rw-r--r-- | drivers/platform/x86/wmi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index f4f68b31eb6a..7753836571fe 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -189,11 +189,10 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, bool enable) snprintf(method, 5, "WE%02X", block->notify_id); status = acpi_execute_simple_method(handle, method, enable); - - if (status != AE_OK && status != AE_NOT_FOUND) - return status; - else + if (status == AE_NOT_FOUND) return AE_OK; + + return status; } /* |
