From ac8974a8de51edc4a7838f60167f279ffe4da0b9 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 28 Sep 2003 22:14:36 +0000 Subject: Clean various MVME188 related routines, fixing typos and removing unnecessary diagnostic code in the process. --- sys/arch/mvme88k/dev/syscon.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'sys/arch/mvme88k/dev/syscon.c') diff --git a/sys/arch/mvme88k/dev/syscon.c b/sys/arch/mvme88k/dev/syscon.c index 37b4cd44939..76c7c030de3 100644 --- a/sys/arch/mvme88k/dev/syscon.c +++ b/sys/arch/mvme88k/dev/syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscon.c,v 1.11 2003/06/02 07:06:56 deraadt Exp $ */ +/* $OpenBSD: syscon.c,v 1.12 2003/09/28 22:14:33 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -76,8 +76,8 @@ struct sysconsoftc { void *sc_paddr; struct sysconreg *sc_syscon; /* the actual registers */ struct intrhand sc_abih; /* `abort' switch */ - struct intrhand sc_acih; /* `ac fial' */ - struct intrhand sc_sfih; /* `sys fial' */ + struct intrhand sc_acih; /* `ac fail' */ + struct intrhand sc_sfih; /* `sys fail' */ struct intrhand sc_m188ih; /* `m188 interrupt' */ }; @@ -97,7 +97,7 @@ struct cfdriver syscon_cd = { NULL, "syscon", DV_DULL, 0 }; -struct sysconreg *sys_syscon = NULL; +struct sysconreg *sys_syscon; int syscon_print(void *args, const char *bus); int syscon_scan(struct device *parent, void *child, void *args); @@ -111,9 +111,17 @@ sysconmatch(parent, vcf, args) struct sysconreg *syscon; /* Don't match if wrong cpu */ - if (brdtyp != BRD_188) return (0); /* The only one... */ - /* Uh, MVME188 better have on of these, so always match if it - * is a MVME188... */ + if (brdtyp != BRD_188) + return (0); + + /* Only allow one instance */ + if (sys_syscon != NULL) + return (0); + + /* + * Uh, MVME188 better have on of these, so always match if it + * is a MVME188... + */ syscon = (struct sysconreg *)(IIOV(ca->ca_paddr)); return (1); } @@ -174,9 +182,6 @@ sysconattach(parent, self, args) struct confargs *ca = args; struct sysconsoftc *sc = (struct sysconsoftc *)self; - if (sys_syscon) - panic("syscon already attached!"); - /* * since we know ourself to land in intiobase land, * we must adjust our address -- cgit v1.2.3