Commit c2cf5769 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki

ACPI / EC: Fix returning values in acpi_ec_sync_query()

The returning value of acpi_os_execute() is erroneously handled as errno.
This patch corrects it by returning EBUSY to indicate the work queue item
creation failure.
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 01305d41
...@@ -660,14 +660,15 @@ static void acpi_ec_run(void *cxt) ...@@ -660,14 +660,15 @@ static void acpi_ec_run(void *cxt)
static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data)
{ {
u8 value = 0; u8 value = 0;
int status; int result;
acpi_status status;
struct acpi_ec_query_handler *handler; struct acpi_ec_query_handler *handler;
status = acpi_ec_query_unlocked(ec, &value); result = acpi_ec_query_unlocked(ec, &value);
if (data) if (data)
*data = value; *data = value;
if (status) if (result)
return status; return result;
list_for_each_entry(handler, &ec->list, node) { list_for_each_entry(handler, &ec->list, node) {
if (value == handler->query_bit) { if (value == handler->query_bit) {
...@@ -675,12 +676,15 @@ static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) ...@@ -675,12 +676,15 @@ static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data)
handler = acpi_ec_get_query_handler(handler); handler = acpi_ec_get_query_handler(handler);
pr_debug("##### Query(0x%02x) scheduled #####\n", pr_debug("##### Query(0x%02x) scheduled #####\n",
handler->query_bit); handler->query_bit);
return acpi_os_execute((handler->func) ? status = acpi_os_execute((handler->func) ?
OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER, OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER,
acpi_ec_run, handler); acpi_ec_run, handler);
if (ACPI_FAILURE(status))
result = -EBUSY;
break;
} }
} }
return 0; return result;
} }
static void acpi_ec_gpe_query(void *ec_cxt) static void acpi_ec_gpe_query(void *ec_cxt)
......
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