[PATCH 2/2] hp-wmi - properly handle errors returned by wmi_install_notify_handler()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wmi_install_notify_handler() retruns ACPI error codes instead of standard
Exxxx error codes so let's test the error condition properly.

Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>
---

 drivers/platform/x86/hp-wmi.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 1d8a073..88458f3 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -589,12 +589,13 @@ static int hp_wmi_resume_handler(struct device *device)
 
 static int __init hp_wmi_init(void)
 {
+	acpi_status status;
 	int err;
 
 	if (wmi_has_guid(HPWMI_EVENT_GUID)) {
-		err = wmi_install_notify_handler(HPWMI_EVENT_GUID,
-						 hp_wmi_notify, NULL);
-		if (!err)
+		status = wmi_install_notify_handler(HPWMI_EVENT_GUID,
+						    hp_wmi_notify, NULL);
+		if (ACPI_SUCCESS(status))
 			hp_wmi_input_setup();
 	}
 

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux