diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c index fa78678e9055..57c78e765134 100644 --- a/sys/arch/macppc/dev/apm.c +++ b/sys/arch/macppc/dev/apm.c @@ -1,4 +1,4 @@ -/* $NetBSD: apm.c,v 1.9 2003/07/15 02:43:28 lukem Exp $ */ +/* $NetBSD: apm.c,v 1.10 2004/04/15 11:03:15 aymeric Exp $ */ /* $OpenBSD: apm.c,v 1.5 2002/06/07 07:13:59 miod Exp $ */ /*- @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.9 2003/07/15 02:43:28 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.10 2004/04/15 11:03:15 aymeric Exp $"); #include "apm.h" @@ -188,12 +188,18 @@ apmattach(parent, self, aux) struct device *parent, *self; void *aux; { + struct apm_softc *sc = (struct apm_softc *) self; struct pmu_battery_info info; pm_battery_info(0, &info); printf(": battery flags 0x%X, ", info.flags); printf("%d%% charged\n", ((info.cur_charge * 100) / info.max_charge)); + + sc->sc_flags = 0; + sc->event_ptr = 0; + sc->event_count = 0; + lockinit(&sc->sc_lock, PWAIT, "apmlk", 0, 0); } int