diff options
| -rw-r--r-- | drivers/acpi/sysfs.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 41324f0b1bee..fa76f5e41b5c 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
| @@ -648,26 +648,29 @@ static void acpi_global_event_handler(u32 event_type, acpi_handle device, | |||
| 648 | } | 648 | } |
| 649 | } | 649 | } |
| 650 | 650 | ||
| 651 | static int get_status(u32 index, acpi_event_status *status, | 651 | static int get_status(u32 index, acpi_event_status *ret, |
| 652 | acpi_handle *handle) | 652 | acpi_handle *handle) |
| 653 | { | 653 | { |
| 654 | int result; | 654 | acpi_status status; |
| 655 | 655 | ||
| 656 | if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS) | 656 | if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS) |
| 657 | return -EINVAL; | 657 | return -EINVAL; |
| 658 | 658 | ||
| 659 | if (index < num_gpes) { | 659 | if (index < num_gpes) { |
| 660 | result = acpi_get_gpe_device(index, handle); | 660 | status = acpi_get_gpe_device(index, handle); |
| 661 | if (result) { | 661 | if (ACPI_FAILURE(status)) { |
| 662 | ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, | 662 | ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, |
| 663 | "Invalid GPE 0x%x", index)); | 663 | "Invalid GPE 0x%x", index)); |
| 664 | return result; | 664 | return -ENXIO; |
| 665 | } | 665 | } |
| 666 | result = acpi_get_gpe_status(*handle, index, status); | 666 | status = acpi_get_gpe_status(*handle, index, ret); |
| 667 | } else if (index < (num_gpes + ACPI_NUM_FIXED_EVENTS)) | 667 | } else { |
| 668 | result = acpi_get_event_status(index - num_gpes, status); | 668 | status = acpi_get_event_status(index - num_gpes, ret); |
| 669 | } | ||
| 670 | if (ACPI_FAILURE(status)) | ||
| 671 | return -EIO; | ||
| 669 | 672 | ||
| 670 | return result; | 673 | return 0; |
| 671 | } | 674 | } |
| 672 | 675 | ||
| 673 | static ssize_t counter_show(struct kobject *kobj, | 676 | static ssize_t counter_show(struct kobject *kobj, |
