diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-01-14 06:28:33 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-01-23 16:06:49 -0500 |
commit | c2cf5769fae1ce208ea00fa85298d1d19969300a (patch) | |
tree | 0b230fedd4f4b9fc870ac6dc6b33bbd0c568ec8c | |
parent | 01305d4139cd345aa9f64cecfd7fc7b237e1444e (diff) |
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>
-rw-r--r-- | drivers/acpi/ec.c | 16 |
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) | |||
660 | static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) | 660 | static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) |
661 | { | 661 | { |
662 | u8 value = 0; | 662 | u8 value = 0; |
663 | int status; | 663 | int result; |
664 | acpi_status status; | ||
664 | struct acpi_ec_query_handler *handler; | 665 | struct acpi_ec_query_handler *handler; |
665 | 666 | ||
666 | status = acpi_ec_query_unlocked(ec, &value); | 667 | result = acpi_ec_query_unlocked(ec, &value); |
667 | if (data) | 668 | if (data) |
668 | *data = value; | 669 | *data = value; |
669 | if (status) | 670 | if (result) |
670 | return status; | 671 | return result; |
671 | 672 | ||
672 | list_for_each_entry(handler, &ec->list, node) { | 673 | list_for_each_entry(handler, &ec->list, node) { |
673 | if (value == handler->query_bit) { | 674 | if (value == handler->query_bit) { |
@@ -675,12 +676,15 @@ static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) | |||
675 | handler = acpi_ec_get_query_handler(handler); | 676 | handler = acpi_ec_get_query_handler(handler); |
676 | pr_debug("##### Query(0x%02x) scheduled #####\n", | 677 | pr_debug("##### Query(0x%02x) scheduled #####\n", |
677 | handler->query_bit); | 678 | handler->query_bit); |
678 | return acpi_os_execute((handler->func) ? | 679 | status = acpi_os_execute((handler->func) ? |
679 | OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER, | 680 | OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER, |
680 | acpi_ec_run, handler); | 681 | acpi_ec_run, handler); |
682 | if (ACPI_FAILURE(status)) | ||
683 | result = -EBUSY; | ||
684 | break; | ||
681 | } | 685 | } |
682 | } | 686 | } |
683 | return 0; | 687 | return result; |
684 | } | 688 | } |
685 | 689 | ||
686 | static void acpi_ec_gpe_query(void *ec_cxt) | 690 | static void acpi_ec_gpe_query(void *ec_cxt) |