Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amiga Kill a couple of unnecessary cf_unit (ab)uses.



details:   https://anonhg.NetBSD.org/src/rev/03f20c2af5c6
branches:  trunk
changeset: 483684:03f20c2af5c6
user:      kleink <kleink%NetBSD.org@localhost>
date:      Wed Mar 15 20:40:00 2000 +0000

description:
Kill a couple of unnecessary cf_unit (ab)uses.

diffstat:

 sys/arch/amiga/amiga/autoconf.c |  15 ++++++++-------
 sys/arch/amiga/dev/a2kbbc.c     |  10 +++++++---
 sys/arch/amiga/dev/a34kbbc.c    |  10 +++++++---
 3 files changed, 22 insertions(+), 13 deletions(-)

diffs (98 lines):

diff -r dcc4183c8090 -r 03f20c2af5c6 sys/arch/amiga/amiga/autoconf.c
--- a/sys/arch/amiga/amiga/autoconf.c   Wed Mar 15 20:34:43 2000 +0000
+++ b/sys/arch/amiga/amiga/autoconf.c   Wed Mar 15 20:40:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.70 2000/02/06 21:45:03 mhitch Exp $     */
+/*     $NetBSD: autoconf.c,v 1.71 2000/03/15 20:40:00 kleink Exp $     */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -228,13 +228,14 @@
        struct cfdata   *cfp;
        void            *auxp;
 {
+       static int mainbus_matched = 0;
 
-       if (cfp->cf_unit > 0)
-               return(0);
-       /*
-        * We are always here
-        */
-       return(1);
+       /* Allow only one instance. */
+       if (mainbus_matched)
+               return (0);
+
+       mainbus_matched = 1;
+       return (1);
 }
 
 /*
diff -r dcc4183c8090 -r 03f20c2af5c6 sys/arch/amiga/dev/a2kbbc.c
--- a/sys/arch/amiga/dev/a2kbbc.c       Wed Mar 15 20:34:43 2000 +0000
+++ b/sys/arch/amiga/dev/a2kbbc.c       Wed Mar 15 20:40:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: a2kbbc.c,v 1.9 2000/01/03 20:30:51 is Exp $    */
+/*     $NetBSD: a2kbbc.c,v 1.10 2000/03/15 20:40:00 kleink Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -73,11 +73,14 @@
        struct cfdata *cfp;
        void *auxp;
 {
+       static int a2kbbc_matched = 0;
+
        if (!matchname("a2kbbc", auxp))
                return (0);
 
-       if (cfp->cf_unit != 0)
-               return (0);     /* only one of us please */
+       /* Allow only one instance. */
+       if (a2kbbc_matched)
+               return (0);
 
        if (/* is_a1200() || */ is_a3000() || is_a4000() 
 #ifdef DRACO
@@ -90,6 +93,7 @@
        if (a2kugettod(0) == 0)
                return (0);
 
+       a2kbbc_matched = 1;
        return (1);
 }
 
diff -r dcc4183c8090 -r 03f20c2af5c6 sys/arch/amiga/dev/a34kbbc.c
--- a/sys/arch/amiga/dev/a34kbbc.c      Wed Mar 15 20:34:43 2000 +0000
+++ b/sys/arch/amiga/dev/a34kbbc.c      Wed Mar 15 20:40:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: a34kbbc.c,v 1.7 2000/01/06 10:53:34 is Exp $   */
+/*     $NetBSD: a34kbbc.c,v 1.8 2000/03/15 20:40:00 kleink Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -73,11 +73,14 @@
        struct cfdata *cfp;
        void *auxp;
 {
+       static int a34kbbc_matched = 0;
+
        if (!matchname("a34kbbc", auxp))
                return(0);
 
-       if (cfp->cf_unit)
-               return(0);      /* only one of us please */
+       /* Allow only once instance. */
+       if (a34kbbc_matched)
+               return(0);
 
        if (!(is_a3000() || is_a4000()))
                return(0);
@@ -86,6 +89,7 @@
        if (a34kugettod(0) == 0)
                return(0);
 
+       a34kbbc_matched = 1;
        return(1);
 }
 



Home | Main Index | Thread Index | Old Index