public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Len Brown <lenb@kernel.org>, Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-acpi@vger.kernel.org, Paul Rolland <rol@as2917.net>
Subject: [PATCH 2/2] hp-wmi - properly handle errors returned by wmi_install_notify_handler()
Date: Tue, 29 Dec 2009 00:34:25 -0800	[thread overview]
Message-ID: <20091229083420.13097.75563.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091229083226.13097.22110.stgit@localhost.localdomain>

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


  reply	other threads:[~2009-12-29  8:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-29  8:34 [PATCH 1/2] dell-wmi - properly handle errors returned by wmi_install_notify_handler() Dmitry Torokhov
2009-12-29  8:34 ` Dmitry Torokhov [this message]
2009-12-29  8:56 ` Dmitry Torokhov
2009-12-29  8:57 ` Paul Rolland
2009-12-29  9:21   ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091229083420.13097.75563.stgit@localhost.localdomain \
    --to=dmitry.torokhov@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rol@as2917.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox