public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes
@ 2009-12-18  6:19 Dmitry Torokhov
  2009-12-18 14:28 ` Matthew Garrett
  2009-12-24  5:45 ` Len Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2009-12-18  6:19 UTC (permalink / raw)
  To: Len Brown; +Cc: Matthew Garrett, linux-acpi

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes
  2009-12-18  6:19 [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes Dmitry Torokhov
@ 2009-12-18 14:28 ` Matthew Garrett
  2009-12-24  5:45 ` Len Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2009-12-18 14:28 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Len Brown, linux-acpi

On Thu, Dec 17, 2009 at 10:19:42PM -0800, Dmitry Torokhov wrote:
> 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>

Acked-by: Matthew Garrett <mjg@redhat.com>

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes
  2009-12-18  6:19 [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes Dmitry Torokhov
  2009-12-18 14:28 ` Matthew Garrett
@ 2009-12-24  5:45 ` Len Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Len Brown @ 2009-12-24  5:45 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Matthew Garrett, linux-acpi

applied

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-24  5:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-18  6:19 [PATCH] dell-wmi - do not keep driver loaded on unsupported boxes Dmitry Torokhov
2009-12-18 14:28 ` Matthew Garrett
2009-12-24  5:45 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox