summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2007-01-27 01:21:15 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2007-01-27 01:21:15 +0000
commit2a0be965805a583fe233577b80fc3d0c271bbb70 (patch)
treec2a4110fb072993d01b026b2e16f89e838d25cfc /sys/dev
parenta3f355d44d986a17843978dc23d4ad14b8ca673f (diff)
Reading the spec again it seems I missed that the _INI method
should be invoked only when _STA says the device is present. Change acpidock_attach to this.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpidock.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/acpi/acpidock.c b/sys/dev/acpi/acpidock.c
index 173cd8859a5..f9c09e1c409 100644
--- a/sys/dev/acpi/acpidock.c
+++ b/sys/dev/acpi/acpidock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidock.c,v 1.6 2007/01/25 21:45:42 mk Exp $ */
+/* $OpenBSD: acpidock.c,v 1.7 2007/01/27 01:21:14 mk Exp $ */
/*
* Copyright (c) 2006,2007 Michael Knudsen <mk@openbsd.org>
*
@@ -74,22 +74,19 @@ acpidock_attach(struct device *parent, struct device *self, void *aux)
printf(": %s", sc->sc_devnode->parent->name);
- sc->sc_docked = ACPIDOCK_STATUS_UNKNOWN;
-
- if (!acpidock_init(sc)) {
- printf(": couldn't initialize\n");
- return;
- }
-
acpidock_status(sc);
- printf(": %s (%d)\n",
- sc->sc_docked == ACPIDOCK_STATUS_DOCKED ? "docked" : "undocked",
- sc->sc_sta);
-
if (sc->sc_docked == ACPIDOCK_STATUS_DOCKED) {
+ if (!acpidock_init(sc)) {
+ printf(": couldn't initialize\n");
+ return;
+ } else
+ printf(": docked (%d)\n", sc->sc_sta);
+
acpidock_docklock(sc, 1);
acpidock_dockctl(sc, 1);
} else {
+ printf(": not docked (%d)\n", sc->sc_sta);
+
acpidock_dockctl(sc, 0);
acpidock_docklock(sc, 0);
}