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

Dmitry Torokhov
2009-12-29T08:34:27Z

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@mail.ru>
---

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();
}