Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Turns out all we need is AcpiClearEvent in the ...



details:   https://anonhg.NetBSD.org/src/rev/ca973148451e
branches:  trunk
changeset: 767982:ca973148451e
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Aug 05 18:59:44 2011 +0000

description:
Turns out all we need is AcpiClearEvent in the right place,
and we don't really care if it fails.  Pointed out by jmcneill.

diffstat:

 sys/dev/acpi/acpi.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (48 lines):

diff -r 73767f31ab42 -r ca973148451e sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Fri Aug 05 18:27:48 2011 +0000
+++ b/sys/dev/acpi/acpi.c       Fri Aug 05 18:59:44 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.249 2011/08/05 18:27:48 jakllsch Exp $      */
+/*     $NetBSD: acpi.c,v 1.250 2011/08/05 18:59:44 jakllsch Exp $      */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.249 2011/08/05 18:27:48 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.250 2011/08/05 18:59:44 jakllsch Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -1174,6 +1174,8 @@
                goto fail;
        }
 
+       AcpiClearEvent(event);
+
        rv = AcpiInstallFixedEventHandler(event,
            acpi_fixed_button_handler, smpsw);
 
@@ -1185,20 +1187,6 @@
        aprint_debug_dev(sc->sc_dev, "fixed %s button present\n",
            (type != ACPI_EVENT_SLEEP_BUTTON) ? "power" : "sleep");
 
-       rv = AcpiClearEvent(event)
-       if (ACPI_FAILURE(rv)) {
-               aprint_error_dev(sc->sc_dev,
-                   "fixed event %d did not clear: %s\n",
-                   event, AcpiFormatException(rv));
-       }
-
-       rv = AcpiEnableEvent(event, 0))
-       if (ACPI_FAILURE(rv)) {
-               aprint_error_dev(sc->sc_dev,
-                   "fixed event %d did not enable: %s\n",
-                   event, AcpiFormatException(rv));
-       }
-
        return;
 
 fail:



Home | Main Index | Thread Index | Old Index