From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Len Brown <len.brown@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>, linux-acpi@vger.kernel.org
Subject: [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes
Date: Thu, 17 Dec 2009 22:19:42 -0800 [thread overview]
Message-ID: <20091218061941.GD21231@core.coreip.homeip.net> (raw)
There is no point in having the driver loaded in memory if we fail
to locate particular WMI GUID.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/platform/x86/dell-wmi.c | 41 ++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c
index 67f3fe7..46244c6 100644
--- a/drivers/platform/x86/dell-wmi.c
+++ b/drivers/platform/x86/dell-wmi.c
@@ -324,37 +324,34 @@ static int __init dell_wmi_init(void)
int err;
if (wmi_has_guid(DELL_EVENT_GUID)) {
+ printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
+ return -ENODEV;
+ }
- dmi_walk(find_hk_type, NULL);
-
- err = dell_wmi_input_setup();
-
- if (err)
- return err;
-
- err = wmi_install_notify_handler(DELL_EVENT_GUID,
- dell_wmi_notify, NULL);
- if (err) {
- input_unregister_device(dell_wmi_input_dev);
- printk(KERN_ERR "dell-wmi: Unable to register"
- " notify handler - %d\n", err);
- return err;
- }
+ dmi_walk(find_hk_type, NULL);
+ acpi_video = acpi_video_backlight_support();
- acpi_video = acpi_video_backlight_support();
+ err = dell_wmi_input_setup();
+ if (err)
+ return err;
- } else
- printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
+ err = wmi_install_notify_handler(DELL_EVENT_GUID,
+ dell_wmi_notify, NULL);
+ if (err) {
+ input_unregister_device(dell_wmi_input_dev);
+ printk(KERN_ERR
+ "dell-wmi: Unable to register notify handler - %d\n",
+ err);
+ return err;
+ }
return 0;
}
static void __exit dell_wmi_exit(void)
{
- if (wmi_has_guid(DELL_EVENT_GUID)) {
- wmi_remove_notify_handler(DELL_EVENT_GUID);
- input_unregister_device(dell_wmi_input_dev);
- }
+ wmi_remove_notify_handler(DELL_EVENT_GUID);
+ input_unregister_device(dell_wmi_input_dev);
}
module_init(dell_wmi_init);
--
Dmitry
next reply other threads:[~2009-12-18 6:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-18 6:19 Dmitry Torokhov [this message]
2009-12-18 14:28 ` [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes Matthew Garrett
2009-12-24 5:45 ` Len Brown
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=20091218061941.GD21231@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=mjg@redhat.com \
/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