Commit 736b48aa authored by Barnabás Pőcze's avatar Barnabás Pőcze Committed by Hans de Goede

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: default avatarBarnabás Pőcze <pobrn@protonmail.com>
Link: https://lore.kernel.org/r/20210904175450.156801-26-pobrn@protonmail.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1975718c
...@@ -189,11 +189,10 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, bool enable) ...@@ -189,11 +189,10 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, bool enable)
snprintf(method, 5, "WE%02X", block->notify_id); snprintf(method, 5, "WE%02X", block->notify_id);
status = acpi_execute_simple_method(handle, method, enable); status = acpi_execute_simple_method(handle, method, enable);
if (status == AE_NOT_FOUND)
if (status != AE_OK && status != AE_NOT_FOUND)
return status;
else
return AE_OK; return AE_OK;
return status;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment