summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2014-10-16 17:46:07 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2014-10-16 17:46:07 +0000
commit8ec3479fe0d84e2e04b3e35eb30791095937443e (patch)
tree6db586370707dd0a64ded7d8f64beb325f8851fc /sys/dev/acpi
parent4e589268eb848bb62df50feaa92fe943a3acafaf (diff)
LID control method devices aren't required to offer _PSW, so don't skip
putting a LID into the global list of LIDs if we encounter an error writing to _PSW for that LID. Needed for another upcoming diff. ok deraadt, phessler
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpibtn.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/acpi/acpibtn.c b/sys/dev/acpi/acpibtn.c
index a31403ae432..94f18638537 100644
--- a/sys/dev/acpi/acpibtn.c
+++ b/sys/dev/acpi/acpibtn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibtn.c,v 1.36 2014/09/14 14:17:24 jsg Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.37 2014/10/16 17:46:06 mlarkin Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -132,11 +132,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 (acpibtn_setpsw(sc, 0) == 0) {
- lid = malloc(sizeof(*lid), M_DEVBUF, M_WAITOK | M_ZERO);
- lid->abl_softc = sc;
- SLIST_INSERT_HEAD(&acpibtn_lids, lid, abl_link);
- }
+
+ /* Set PSW (if present) to disable wake on this LID */
+ (void)acpibtn_setpsw(sc, 0);
+ lid = malloc(sizeof(*lid), M_DEVBUF, M_WAITOK | M_ZERO);
+ lid->abl_softc = sc;
+ SLIST_INSERT_HEAD(&acpibtn_lids, lid, abl_link);
} else if (!strcmp(aa->aaa_dev, ACPI_DEV_PBD))
sc->sc_btn_type = ACPIBTN_POWER;
else if (!strcmp(aa->aaa_dev, ACPI_DEV_SBD))