summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorgdamore <gdamore@NetBSD.org>2006-03-28 16:52:35 +0000
committergdamore <gdamore@NetBSD.org>2006-03-28 16:52:35 +0000
commit203fcf4dc2dfdafabfcee710f101ee27d1335a73 (patch)
treeea0a07b7c1e11a7898cb36ce0b4d5081f6c34143 /sys
parenta3102ea4c1948c0d615a9c92112622ed2a4d252d (diff)
Use todr_attach.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips/alchemy/dev/aurtc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/arch/mips/alchemy/dev/aurtc.c b/sys/arch/mips/alchemy/dev/aurtc.c
index e57c70f6067..dd234d36e43 100644
--- a/sys/arch/mips/alchemy/dev/aurtc.c
+++ b/sys/arch/mips/alchemy/dev/aurtc.c
@@ -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);
}
/*