Turns out all we need is AcpiClearEvent in the right place,

and we don't really care if it fails.  Pointed out by jmcneill.
This commit is contained in:
jakllsch 2011-08-05 18:59:44 +00:00
parent aff0a6a01c
commit 704e16c17e

View File

@ -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 @@ acpi_register_fixed_button(struct acpi_softc *sc, int event)
goto fail;
}
AcpiClearEvent(event);
rv = AcpiInstallFixedEventHandler(event,
acpi_fixed_button_handler, smpsw);
@ -1185,20 +1187,6 @@ acpi_register_fixed_button(struct acpi_softc *sc, int event)
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: