summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-01-14 19:28:33 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-01-23 22:06:49 +0100
commitc2cf5769fae1ce208ea00fa85298d1d19969300a (patch)
tree0b230fedd4f4b9fc870ac6dc6b33bbd0c568ec8c /drivers/acpi/ec.c
parent01305d4139cd345aa9f64cecfd7fc7b237e1444e (diff)
downloadlinux-c2cf5769fae1ce208ea00fa85298d1d19969300a.tar.gz
linux-c2cf5769fae1ce208ea00fa85298d1d19969300a.tar.bz2
linux-c2cf5769fae1ce208ea00fa85298d1d19969300a.zip
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: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 87b9911c9039..a94ee9f7defd 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -660,14 +660,15 @@ static void acpi_ec_run(void *cxt)
static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data)
{
u8 value = 0;
- int status;
+ int result;
+ acpi_status status;
struct acpi_ec_query_handler *handler;
- status = acpi_ec_query_unlocked(ec, &value);
+ result = acpi_ec_query_unlocked(ec, &value);
if (data)
*data = value;
- if (status)
- return status;
+ if (result)
+ return result;
list_for_each_entry(handler, &ec->list, node) {
if (value == handler->query_bit) {
@@ -675,12 +676,15 @@ static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data)
handler = acpi_ec_get_query_handler(handler);
pr_debug("##### Query(0x%02x) scheduled #####\n",
handler->query_bit);
- return acpi_os_execute((handler->func) ?
+ status = acpi_os_execute((handler->func) ?
OSL_NOTIFY_HANDLER : OSL_GPE_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)