public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Karol Kozimor <sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
To: Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 2/4] acpi4asus update:
Date: Thu, 9 Sep 2004 00:45:11 +0200	[thread overview]
Message-ID: <20040908224511.GB9953@hell.org.pl> (raw)
In-Reply-To: <20040908223807.GA9953-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>

Hi,
This patch accounts for the new behaviour of acpi_bus_register_driver() and
makes the driver bail out if no suitable devices to bind to are found.

I *think* that with the acpi_disabled check in place calling
acpi_bus_unregister_driver() is safe in that context.

Please apply, TIA

Signed-off-by: Karol Kozimor <sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>

Index: asus_core.c
===================================================================
RCS file: /cvsroot/acpi4asus/acpi4asus/driver/asus_core.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- a/drivers/acpi/asus_acpi.c	5 Aug 2004 18:43:54 -0000	1.104
+++ b/drivers/acpi/asus_acpi.c	7 Sep 2004 22:23:41 -0000	1.105
@@ -1214,20 +1214,24 @@
 {
 	int result;
 
+	if (acpi_disabled)
+		return -ENODEV;
+
 	asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
 	if (!asus_proc_dir) {
 		printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
-		return(-ENODEV);
+		return -ENODEV;
 	}
 	asus_proc_dir->owner = THIS_MODULE;
 
 	result = acpi_bus_register_driver(&asus_hotk_driver);
-	if (result < 0) {
+	if (result < 1) {
+		acpi_bus_unregister_driver(&asus_hotk_driver);
 		remove_proc_entry(PROC_ASUS, acpi_root_dir);
-		return(-ENODEV);
+		return -ENODEV;
 	}
 
-	return(0);
+	return 0;
 }
 
 
-- 
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click

  parent reply	other threads:[~2004-09-08 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-08 22:38 [PATCH 1/4] acpi4asus update: support W1N, v0.29 Karol Kozimor
     [not found] ` <20040908223807.GA9953-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-09-08 22:45   ` Karol Kozimor [this message]
     [not found] ` <20040908224511.GB9953-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-09-08 22:48   ` [PATCH 3/4] acpi4asus update: support M6R Karol Kozimor
     [not found] ` <20040908224831.GC9953-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-09-08 22:54   ` [PATCH 4/4] acpi4asus update: make hotk struct global Karol Kozimor
     [not found]     ` <20040908225415.GD9953-DETuoxkZsSqrDJvtcaxF/A@public.gmane.org>
2004-10-09  4:28       ` 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=20040908224511.GB9953@hell.org.pl \
    --to=sziwan-detuoxkzssqrdjvtcaxf/a@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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