Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga/dev Kill more broken cf_unit bogons.



details:   https://anonhg.NetBSD.org/src/rev/b425839f25e2
branches:  trunk
changeset: 483721:b425839f25e2
user:      kleink <kleink%NetBSD.org@localhost>
date:      Thu Mar 16 16:37:20 2000 +0000

description:
Kill more broken cf_unit bogons.

diffstat:

 sys/arch/amiga/dev/aucc.c    |  15 +++++++++------
 sys/arch/amiga/dev/drbbc.c   |  12 ++++++++----
 sys/arch/amiga/dev/drsc.c    |  13 +++++++++----
 sys/arch/amiga/dev/drsupio.c |  11 ++++++-----
 sys/arch/amiga/dev/fd.c      |  15 +++++++++------
 sys/arch/amiga/dev/par.c     |  11 +++++++----
 sys/arch/amiga/dev/ser.c     |   8 ++++++--
 7 files changed, 54 insertions(+), 31 deletions(-)

diffs (213 lines):

diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/aucc.c
--- a/sys/arch/amiga/dev/aucc.c Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/aucc.c Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aucc.c,v 1.24 1999/03/04 20:45:01 is Exp $     */
+/*     $NetBSD: aucc.c,v 1.25 2000/03/16 16:37:20 kleink Exp $ */
 
 /*
  * Copyright (c) 1999 Bernardo Innocenti
@@ -269,14 +269,17 @@
        struct cfdata *cfp;
        void *aux;
 {
-       if (matchname((char *)aux, "aucc") &&
+       static int aucc_matched = 0;
+
+       if (!matchname((char *)aux, "aucc") ||
 #ifdef DRACO
-           !is_draco() &&
+           is_draco() ||
 #endif
-           (cfp->cf_unit == 0))
-               return 1;
+           aucc_matched)
+               return 0;
 
-       return 0;
+       aucc_matched = 1;
+       return 1;
 }
 
 /*
diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/drbbc.c
--- a/sys/arch/amiga/dev/drbbc.c        Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/drbbc.c        Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drbbc.c,v 1.5 1999/03/14 22:42:12 is Exp $     */
+/*     $NetBSD: drbbc.c,v 1.6 2000/03/16 16:37:20 kleink Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -83,10 +83,14 @@
        struct cfdata *cfp;
        void *auxp;
 {
-       if (is_draco() && matchname(auxp, "drbbc") && (cfp->cf_unit == 0))
-               return (1);
-       else
+       static int drbbc_matched = 0;
+
+       /* Allow only one instance. */
+       if (!is_draco() || !matchname(auxp, "drbbc") || drbbc_matched)
                return (0);
+
+       drbbc_matched = 1;
+       return (1);
 }
 
 void
diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/drsc.c
--- a/sys/arch/amiga/dev/drsc.c Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/drsc.c Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drsc.c,v 1.16 2000/01/16 21:19:44 is Exp $     */
+/*     $NetBSD: drsc.c,v 1.17 2000/03/16 16:37:20 kleink Exp $ */
 
 /*
  * Copyright (c) 1996 Ignatios Souvatzis
@@ -89,9 +89,14 @@
        struct cfdata *cfp;
        void *auxp;
 {
-       if (is_draco() && matchname(auxp, "drsc") && (cfp->cf_unit == 0))
-               return(1);
-       return(0);
+       static int drsc_matched = 0;
+
+       /* Allow only one instance. */
+       if (!is_draco() || !matchname(auxp, "drsc") || drsc_matched)
+               return (0);
+
+       drsc_matched = 1;
+       return(1);
 }
 
 void
diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/drsupio.c
--- a/sys/arch/amiga/dev/drsupio.c      Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/drsupio.c      Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drsupio.c,v 1.7 1999/12/30 20:56:45 is Exp $ */
+/*     $NetBSD: drsupio.c,v 1.8 2000/03/16 16:37:20 kleink Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -77,13 +77,14 @@
        struct cfdata *cfp;
        void *auxp;
 {
+       static int drsupio_matched = 0;
 
        /* Exactly one of us lives on the DraCo */
+       if (!is_draco() || !matchname(auxp, "drsupio") || drsupio_matched)
+               return 0;
 
-       if (is_draco() && matchname(auxp, "drsupio") && (cfp->cf_unit == 0))
-               return 1;
-
-       return 0;
+       drsupio_matched = 1;
+       return 1;
 }
 
 struct drsupio_devs {
diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/fd.c
--- a/sys/arch/amiga/dev/fd.c   Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/fd.c   Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.43 2000/02/07 20:16:48 thorpej Exp $  */
+/*     $NetBSD: fd.c,v 1.44 2000/03/16 16:37:20 kleink Exp $   */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -310,13 +310,17 @@
        struct cfdata *cfp;
        void *auxp;
 {
+       static int fdc_matched = 0;
 
-       if (matchname("fdc", auxp) == 0 || cfp->cf_unit != 0)
+       /* Allow only once instance. */
+       if (matchname("fdc", auxp) == 0 || fdc_matched)
                return(0);
        if ((fdc_dmap = alloc_chipmem(DMABUFSZ)) == NULL) {
                printf("fdc: unable to allocate dma buffer\n");
                return(0);
        }
+
+       fdc_matched = 1;
        return(1);
 }
 
@@ -362,15 +366,14 @@
        struct cfdata *cfp;
        void *auxp;
 {
-
-#define cf_unit        cf_loc[FDCCF_UNIT]
        struct fdcargs *fdap;
 
        fdap = auxp;
-       if (cfp->cf_unit == fdap->unit || cfp->cf_unit == FDCCF_UNIT_DEFAULT)
+       if (cfp->cf_loc[FDCCF_UNIT] == fdap->unit ||
+           cfp->cf_loc[FDCCF_UNIT] == FDCCF_UNIT_DEFAULT)
                return(1);
+
        return(0);
-#undef cf_unit
 }
 
 void
diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/par.c
--- a/sys/arch/amiga/dev/par.c  Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/par.c  Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: par.c,v 1.18 1999/08/05 18:08:09 thorpej Exp $ */
+/*     $NetBSD: par.c,v 1.19 2000/03/16 16:37:20 kleink Exp $  */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -112,10 +112,13 @@
        struct cfdata *cfp;
        void *auxp;
 {
+       static int par_found = 0;
 
-       if (matchname((char *)auxp, "par") && cfp->cf_unit == 0)
-               return(1);
-       return(0);
+       if (!matchname((char *)auxp, "par") || par_found)
+               return(0);
+
+       par_found = 1;
+       return(1);
 }
 
 void
diff -r 6d716e82925d -r b425839f25e2 sys/arch/amiga/dev/ser.c
--- a/sys/arch/amiga/dev/ser.c  Thu Mar 16 15:35:29 2000 +0000
+++ b/sys/arch/amiga/dev/ser.c  Thu Mar 16 16:37:20 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ser.c,v 1.49 1998/07/22 19:13:02 is Exp $      */
+/*     $NetBSD: ser.c,v 1.50 2000/03/16 16:37:21 kleink Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -181,11 +181,15 @@
        struct cfdata *cfp;
        void *auxp;
 {
+       static int ser_matched = 0;
 
-       if (matchname("ser", (char *)auxp) == 0 || cfp->cf_unit != 0)
+       /* Allow only once instance. */
+       if (matchname("ser", (char *)auxp) == 0 || ser_matched)
                return(0);
        if (serconsole != 0 && amiga_realconfig == 0)
                return(0);
+
+       ser_matched = 1;
        return(1);
 }
 



Home | Main Index | Thread Index | Old Index