Commit 1fdd407f authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Len Brown

dell-wmi: do not keep driver loaded on unsupported boxes

There is no point in having the driver loaded in memory if we fail
to locate particular WMI GUID.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarMatthew Garrett <mjg@redhat.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 3e9b988e
...@@ -325,11 +325,14 @@ static int __init dell_wmi_init(void) ...@@ -325,11 +325,14 @@ static int __init dell_wmi_init(void)
int err; int err;
if (wmi_has_guid(DELL_EVENT_GUID)) { 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); dmi_walk(find_hk_type, NULL);
acpi_video = acpi_video_backlight_support();
err = dell_wmi_input_setup(); err = dell_wmi_input_setup();
if (err) if (err)
return err; return err;
...@@ -337,25 +340,19 @@ static int __init dell_wmi_init(void) ...@@ -337,25 +340,19 @@ static int __init dell_wmi_init(void)
dell_wmi_notify, NULL); dell_wmi_notify, NULL);
if (err) { if (err) {
input_unregister_device(dell_wmi_input_dev); input_unregister_device(dell_wmi_input_dev);
printk(KERN_ERR "dell-wmi: Unable to register" printk(KERN_ERR
" notify handler - %d\n", err); "dell-wmi: Unable to register notify handler - %d\n",
err);
return err; return err;
} }
acpi_video = acpi_video_backlight_support();
} else
printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
return 0; return 0;
} }
static void __exit dell_wmi_exit(void) static void __exit dell_wmi_exit(void)
{ {
if (wmi_has_guid(DELL_EVENT_GUID)) {
wmi_remove_notify_handler(DELL_EVENT_GUID); wmi_remove_notify_handler(DELL_EVENT_GUID);
input_unregister_device(dell_wmi_input_dev); input_unregister_device(dell_wmi_input_dev);
}
} }
module_init(dell_wmi_init); module_init(dell_wmi_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment