summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorDmitry Torokhov2010-08-26 09:14:42 +0200
committerMatthew Garrett2010-10-21 15:36:46 +0200
commit5212cd678af82fef00f6d60d14de01c1211aad56 (patch)
tree8d19ceef8de9e4ac568cc498b2dc47245eb2ce08 /drivers/platform
parentasus-laptop: use attribute group to manage attributes (diff)
downloadkernel-qcow2-linux-5212cd678af82fef00f6d60d14de01c1211aad56.tar.gz
kernel-qcow2-linux-5212cd678af82fef00f6d60d14de01c1211aad56.tar.xz
kernel-qcow2-linux-5212cd678af82fef00f6d60d14de01c1211aad56.zip
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')
-rw-r--r--drivers/platform/x86/wmi.c9
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)
ACPI_ADR_SPACE_EC,
&acpi_wmi_ec_space_handler,
NULL, NULL);
- if (ACPI_FAILURE(status))
+ if (ACPI_FAILURE(status)) {
+ printk(KERN_ERR PREFIX "Error installing EC region handler\n");
return -ENODEV;
+ }
status = parse_wdg(device->handle);
if (ACPI_FAILURE(status)) {
- printk(KERN_ERR PREFIX "Error installing EC region handler\n");
+ acpi_remove_address_space_handler(device->handle,
+ ACPI_ADR_SPACE_EC,
+ &acpi_wmi_ec_space_handler);
+ printk(KERN_ERR PREFIX "Failed to parse WDG method\n");
return -ENODEV;
}