Use todr_attach.

This commit is contained in:
gdamore 2006-03-28 16:52:35 +00:00
parent a3102ea4c1
commit 203fcf4dc2
1 changed files with 4 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: aurtc.c,v 1.9 2006/03/28 03:43:58 gdamore Exp $ */
/* $NetBSD: aurtc.c,v 1.10 2006/03/28 16:52:35 gdamore Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -68,7 +68,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aurtc.c,v 1.9 2006/03/28 03:43:58 gdamore Exp $");
__KERNEL_RCSID(0, "$NetBSD: aurtc.c,v 1.10 2006/03/28 16:52:35 gdamore Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -84,9 +84,6 @@ __KERNEL_RCSID(0, "$NetBSD: aurtc.c,v 1.9 2006/03/28 03:43:58 gdamore Exp $");
#include <mips/alchemy/include/auvar.h>
#include <mips/alchemy/include/aubusvar.h>
/* provided in machdep code */
extern todr_chip_handle_t todr_handle;
#define REGVAL(x) (*(volatile uint32_t *)(MIPS_PHYS_TO_KSEG1(PC_BASE + (x))))
#define GETREG(x) (REGVAL(x))
#define PUTREG(x,v) (REGVAL(x) = (v))
@ -124,15 +121,8 @@ aurtc_attach(struct device *parent, struct device *self, void *aux)
{
struct aurtc_softc *sc = (struct aurtc_softc *)self;
if (todr_handle != NULL) {
printf(": another TOD clock is already registered\n");
return;
}
printf(": Au1X00 programmable clock\n");
todr_handle = &sc->sc_tch;
sc->sc_tch.cookie = sc;
sc->sc_tch.bus_cookie = NULL;
sc->sc_tch.todr_gettime = aurtc_gettime;
@ -142,6 +132,8 @@ aurtc_attach(struct device *parent, struct device *self, void *aux)
sc->sc_tch.todr_setwen = NULL;
sc->sc_shutdownhook = shutdownhook_establish(aurtc_shutdown, NULL);
todr_attach(&sc->sc_tch);
}
/*