Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa Change the probe code. You cannot unmap bus spa...



details:   https://anonhg.NetBSD.org/src/rev/042963520d4f
branches:  trunk
changeset: 520077:042963520d4f
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed Jan 02 12:42:23 2002 +0000

description:
Change the probe code.  You cannot unmap bus space and then use it.

diffstat:

 sys/dev/isa/aztech.c      |  12 ++++++------
 sys/dev/isa/radiotrack.c  |  12 ++++++------
 sys/dev/isa/radiotrack2.c |  12 ++++++------
 sys/dev/isa/sf16fmr2.c    |  12 ++++++------
 4 files changed, 24 insertions(+), 24 deletions(-)

diffs (144 lines):

diff -r ffbbd35a047b -r 042963520d4f sys/dev/isa/aztech.c
--- a/sys/dev/isa/aztech.c      Wed Jan 02 12:38:46 2002 +0000
+++ b/sys/dev/isa/aztech.c      Wed Jan 02 12:42:23 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aztech.c,v 1.1 2002/01/01 21:51:41 augustss Exp $ */
+/* $NetBSD: aztech.c,v 1.2 2002/01/02 12:42:23 augustss Exp $ */
 /* $OpenBSD: aztech.c,v 1.2 2001/12/05 10:27:06 mickey Exp $ */
 /* $RuOBSD: aztech.c,v 1.11 2001/10/20 13:23:47 pva Exp $ */
 
@@ -121,7 +121,7 @@
        struct isa_attach_args *ia = aux;
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
-
+       u_int r;
        int iosize = 1, iobase = ia->ia_iobase;
 
        if (!AZ_BASE_VALID(iobase)) {
@@ -132,13 +132,13 @@
        if (bus_space_map(iot, iobase, iosize, 0, &ioh))
                return 0;
 
+       r = az_find(iot, ioh);
+
        bus_space_unmap(iot, ioh, iosize);
 
-       if (!az_find(iot, ioh))
-               return 0;
+       ia->ia_iosize = iosize;
 
-       ia->ia_iosize = iosize;
-       return 1;
+       return (r != 0);
 }
 
 void
diff -r ffbbd35a047b -r 042963520d4f sys/dev/isa/radiotrack.c
--- a/sys/dev/isa/radiotrack.c  Wed Jan 02 12:38:46 2002 +0000
+++ b/sys/dev/isa/radiotrack.c  Wed Jan 02 12:42:23 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radiotrack.c,v 1.2 2002/01/02 04:10:02 augustss Exp $ */
+/* $NetBSD: radiotrack.c,v 1.3 2002/01/02 12:42:23 augustss Exp $ */
 /* $OpenBSD: radiotrack.c,v 1.1 2001/12/05 10:27:06 mickey Exp $ */
 /* $RuOBSD: radiotrack.c,v 1.3 2001/10/18 16:51:36 pva Exp $ */
 
@@ -134,7 +134,7 @@
        struct isa_attach_args *ia = aux;
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
-
+       u_int r;
        int iosize = 1, iobase = ia->ia_iobase;
 
        if (!RT_BASE_VALID(iobase)) {
@@ -145,13 +145,13 @@
        if (bus_space_map(iot, iobase, iosize, 0, &ioh))
                return 0;
 
+       r = rt_find(iot, ioh);
+
        bus_space_unmap(iot, ioh, iosize);
 
-       if (!rt_find(iot, ioh))
-               return 0;
+       ia->ia_iosize = iosize;
 
-       ia->ia_iosize = iosize;
-       return 1;
+       return (r != 0);
 }
 
 void
diff -r ffbbd35a047b -r 042963520d4f sys/dev/isa/radiotrack2.c
--- a/sys/dev/isa/radiotrack2.c Wed Jan 02 12:38:46 2002 +0000
+++ b/sys/dev/isa/radiotrack2.c Wed Jan 02 12:42:23 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radiotrack2.c,v 1.1 2002/01/01 21:51:41 augustss Exp $ */
+/* $NetBSD: radiotrack2.c,v 1.2 2002/01/02 12:42:23 augustss Exp $ */
 /* $OpenBSD: radiotrack2.c,v 1.1 2001/12/05 10:27:06 mickey Exp $ */
 /* $RuOBSD: radiotrack2.c,v 1.2 2001/10/18 16:51:36 pva Exp $ */
 
@@ -124,7 +124,7 @@
        struct isa_attach_args *ia = aux;
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
-
+       u_int r;
        int iosize = 1, iobase = ia->ia_iobase;
 
        if (!RTII_BASE_VALID(iobase)) {
@@ -135,13 +135,13 @@
        if (bus_space_map(iot, iobase, iosize, 0, &ioh))
                return 0;
 
+       r = rtii_find(iot, ioh);
+
        bus_space_unmap(iot, ioh, iosize);
 
-       if (!rtii_find(iot, ioh))
-               return 0;
+       ia->ia_iosize = iosize;
 
-       ia->ia_iosize = iosize;
-       return 1;
+       return (r != 0);
 }
 
 void
diff -r ffbbd35a047b -r 042963520d4f sys/dev/isa/sf16fmr2.c
--- a/sys/dev/isa/sf16fmr2.c    Wed Jan 02 12:38:46 2002 +0000
+++ b/sys/dev/isa/sf16fmr2.c    Wed Jan 02 12:42:23 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sf16fmr2.c,v 1.1 2002/01/01 21:51:41 augustss Exp $ */
+/* $NetBSD: sf16fmr2.c,v 1.2 2002/01/02 12:42:23 augustss Exp $ */
 /* $OpenBSD: sf16fmr2.c,v 1.3 2001/12/18 18:48:08 mickey Exp $ */
 /* $RuOBSD: sf16fmr2.c,v 1.12 2001/10/18 16:51:36 pva Exp $ */
 
@@ -124,7 +124,7 @@
        struct isa_attach_args *ia = aux;
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
-
+       u_int r;
        int iosize = 1, iobase = ia->ia_iobase;
 
        if (!SF16FMR2_BASE_VALID(iobase)) {
@@ -135,13 +135,13 @@
        if (bus_space_map(iot, iobase, iosize, 0, &ioh))
                return 0;
 
+       r = sf2r_find(iot, ioh);
+
        bus_space_unmap(iot, ioh, iosize);
 
-       if (!sf2r_find(iot, ioh))
-               return 0;
+       ia->ia_iosize = iosize;
 
-       ia->ia_iosize = iosize;
-       return 1;
+       return (r != 0);
 }
 
 void



Home | Main Index | Thread Index | Old Index