diff --git a/sys/arch/news68k/dev/mkclock_hb.c b/sys/arch/news68k/dev/mkclock_hb.c index c0daafe0be5d..23d73e8d7110 100644 --- a/sys/arch/news68k/dev/mkclock_hb.c +++ b/sys/arch/news68k/dev/mkclock_hb.c @@ -1,4 +1,4 @@ -/* $NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $ */ +/* $NetBSD: mkclock_hb.c,v 1.8 2003/11/01 22:49:38 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.8 2003/11/01 22:49:38 tsutsui Exp $"); #include #include @@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $ #include #include +#include #include @@ -57,7 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: mkclock_hb.c,v 1.7 2003/07/19 02:25:21 tsutsui Exp $ int mkclock_hb_match(struct device *, struct cfdata *, void *); void mkclock_hb_attach(struct device *, struct device *, void *); -CFATTACH_DECL(mkclock_hb, sizeof(struct device), +CFATTACH_DECL(mkclock_hb, sizeof(struct mk48txx_softc), mkclock_hb_match, mkclock_hb_attach, NULL, NULL); extern struct cfdriver mkclock_cd; @@ -90,23 +91,19 @@ mkclock_hb_attach(parent, self, aux) struct device *parent, *self; void *aux; { + struct mk48txx_softc *sc = (void *)self; struct hb_attach_args *ha = aux; - bus_space_tag_t bst = ha->ha_bust; - bus_space_handle_t bsh; - todr_chip_handle_t handle; - if (bus_space_map(bst, (bus_addr_t)ha->ha_address, ha->ha_size, - 0, &bsh) != 0) + sc->sc_bst = ha->ha_bust; + if (bus_space_map(sc->sc_bst, (bus_addr_t)ha->ha_address, ha->ha_size, + 0, &sc->sc_bsh) != 0) printf("can't map device space\n"); - handle = mk48txx_attach(bst, bsh, "mk48t02", 1900, NULL, NULL); - if (handle == NULL) - panic("can't attach tod clock"); + sc->sc_model = "mk48t02"; + sc->sc_year0 = 1900; + mk48txx_attach(sc); printf("\n"); - handle->bus_cookie = NULL; - handle->todr_setwen = NULL; - - todr_attach(handle); + todr_attach(&sc->sc_handle); }