summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-11-29 19:21:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-11-29 19:21:21 +0000
commitc8549ec07443c95b71df33de0935c1470a7edf42 (patch)
tree012bca18a2aec2a03152818bcdd827e7c5c3d751 /sys/dev/acpi
parentbbc49d8c828bb29315737500043f18ae1b3f8540 (diff)
Do not consider unrecognized buttons as lid sensors. ok marco@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpibtn.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpibtn.c b/sys/dev/acpi/acpibtn.c
index 9b1573f4302..7afd7de6963 100644
--- a/sys/dev/acpi/acpibtn.c
+++ b/sys/dev/acpi/acpibtn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibtn.c,v 1.11 2006/10/12 16:38:21 jordan Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.12 2006/11/29 19:21:20 miod Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -46,6 +46,7 @@ struct acpibtn_softc {
struct aml_node *sc_devnode;
int sc_btn_type;
+#define ACPIBTN_UNKNOWN -1
#define ACPIBTN_LID 0
#define ACPIBTN_POWER 1
#define ACPIBTN_SLEEP 2
@@ -87,10 +88,12 @@ acpibtn_attach(struct device *parent, struct device *self, void *aux)
if (!strcmp(aa->aaa_dev, ACPI_DEV_LD))
sc->sc_btn_type = ACPIBTN_LID;
- if (!strcmp(aa->aaa_dev, ACPI_DEV_PBD))
+ else if (!strcmp(aa->aaa_dev, ACPI_DEV_PBD))
sc->sc_btn_type = ACPIBTN_POWER;
- if (!strcmp(aa->aaa_dev, ACPI_DEV_SBD))
+ else if (!strcmp(aa->aaa_dev, ACPI_DEV_SBD))
sc->sc_btn_type = ACPIBTN_SLEEP;
+ else
+ sc->sc_btn_type = ACPIBTN_UNKNOWN;
acpibtn_getsta(sc);