Module Name:    src
Committed By:   jruoho
Date:           Sun Jan 31 18:51:33 UTC 2010

Modified Files:
        src/sys/dev/acpi: asus_acpi.c

Log Message:
Also remove the ACPI notify handler upon detach.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/acpi/asus_acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/asus_acpi.c
diff -u src/sys/dev/acpi/asus_acpi.c:1.15 src/sys/dev/acpi/asus_acpi.c:1.16
--- src/sys/dev/acpi/asus_acpi.c:1.15	Fri Jan 29 12:22:00 2010
+++ src/sys/dev/acpi/asus_acpi.c	Sun Jan 31 18:51:33 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: asus_acpi.c,v 1.15 2010/01/29 12:22:00 jruoho Exp $ */
+/* $NetBSD: asus_acpi.c,v 1.16 2010/01/31 18:51:33 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 Jared D. McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: asus_acpi.c,v 1.15 2010/01/29 12:22:00 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asus_acpi.c,v 1.16 2010/01/31 18:51:33 jruoho Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -186,8 +186,15 @@
 asus_detach(device_t self, int flags)
 {
 	struct asus_softc *sc = device_private(self);
+	ACPI_STATUS rv;
 	int i;
 
+	rv = AcpiRemoveNotifyHandler(sc->sc_node->ad_handle,
+	    ACPI_ALL_NOTIFY, asus_notify_handler);
+
+	if (ACPI_FAILURE(rv))
+		return EBUSY;
+
 	if (sc->sc_smpsw_valid)
 		for (i = 0; i < ASUS_PSW_LAST; i++)
 			sysmon_pswitch_unregister(&sc->sc_smpsw[i]);

Reply via email to