Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Although sysmon_pswitch_unregister(9) does not ...



details:   https://anonhg.NetBSD.org/src/rev/cfa395f13645
branches:  trunk
changeset: 755447:cfa395f13645
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sun Jun 06 10:44:40 2010 +0000

description:
Although sysmon_pswitch_unregister(9) does not currently do anything, in
order to be ready for possible future API changes, call it if we failed to
install the fixed event handlers. Also small ACPI_DEBUG_PRINT clarifications.

diffstat:

 sys/dev/acpi/acpi.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r a2554aac1f7c -r cfa395f13645 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Sun Jun 06 10:22:43 2010 +0000
+++ b/sys/dev/acpi/acpi.c       Sun Jun 06 10:44:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.198 2010/06/05 06:07:12 jruoho Exp $        */
+/*     $NetBSD: acpi.c,v 1.199 2010/06/06 10:44:40 jruoho Exp $        */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.198 2010/06/05 06:07:12 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.199 2010/06/06 10:44:40 jruoho Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -1252,8 +1252,10 @@
        rv = AcpiInstallFixedEventHandler(event,
            acpi_fixed_button_handler, smpsw);
 
-       if (ACPI_FAILURE(rv))
+       if (ACPI_FAILURE(rv)) {
+               sysmon_pswitch_unregister(smpsw);
                goto fail;
+       }
 
        aprint_debug_dev(sc->sc_dev, "fixed %s button present\n",
            (type != ACPI_EVENT_SLEEP_BUTTON) ? "power" : "sleep");
@@ -1316,8 +1318,6 @@
        static const int handler = OSL_NOTIFY_HANDLER;
        struct sysmon_pswitch *smpsw = context;
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "fixed event\n"));
-
        (void)AcpiOsExecute(handler, acpi_fixed_button_pressed, smpsw);
 
        return ACPI_INTERRUPT_HANDLED;
@@ -1328,8 +1328,9 @@
 {
        struct sysmon_pswitch *smpsw = context;
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-               "%s fixed button pressed\n", smpsw->smpsw_name));
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s fixed button pressed\n",
+               (smpsw->smpsw_type != ACPI_EVENT_SLEEP_BUTTON) ?
+               "power" : "sleep"));
 
        sysmon_pswitch_event(smpsw, PSWITCH_EVENT_PRESSED);
 }



Home | Main Index | Thread Index | Old Index