diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-08-26 03:14:42 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-10-21 09:36:46 -0400 |
commit | 5212cd678af82fef00f6d60d14de01c1211aad56 (patch) | |
tree | 8d19ceef8de9e4ac568cc498b2dc47245eb2ce08 /drivers/platform/x86 | |
parent | ac9b1e5b63d5d9829ecf2294f0486ccd270c5db4 (diff) |
WMI: remove EC region handler when _WDG parsing fails
Driver initialization was forgetting to remove EC address space handler
in cases when parse_wdg() method failed.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/wmi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 49806824a463..63d0b65deffb 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -956,12 +956,17 @@ static int acpi_wmi_add(struct acpi_device *device) | |||
956 | ACPI_ADR_SPACE_EC, | 956 | ACPI_ADR_SPACE_EC, |
957 | &acpi_wmi_ec_space_handler, | 957 | &acpi_wmi_ec_space_handler, |
958 | NULL, NULL); | 958 | NULL, NULL); |
959 | if (ACPI_FAILURE(status)) | 959 | if (ACPI_FAILURE(status)) { |
960 | printk(KERN_ERR PREFIX "Error installing EC region handler\n"); | ||
960 | return -ENODEV; | 961 | return -ENODEV; |
962 | } | ||
961 | 963 | ||
962 | status = parse_wdg(device->handle); | 964 | status = parse_wdg(device->handle); |
963 | if (ACPI_FAILURE(status)) { | 965 | if (ACPI_FAILURE(status)) { |
964 | printk(KERN_ERR PREFIX "Error installing EC region handler\n"); | 966 | acpi_remove_address_space_handler(device->handle, |
967 | ACPI_ADR_SPACE_EC, | ||
968 | &acpi_wmi_ec_space_handler); | ||
969 | printk(KERN_ERR PREFIX "Failed to parse WDG method\n"); | ||
965 | return -ENODEV; | 970 | return -ENODEV; |
966 | } | 971 | } |
967 | 972 | ||