From c41bbdcea2eee7da22dc77b01ce75fd59ac01b58 Mon Sep 17 00:00:00 2001 From: augustss Date: Wed, 2 Jan 2002 12:42:23 +0000 Subject: [PATCH] Change the probe code. You cannot unmap bus space and then use it. --- 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(-) diff --git a/sys/dev/isa/aztech.c b/sys/dev/isa/aztech.c index b146bb437416..111988adaec3 100644 --- a/sys/dev/isa/aztech.c +++ b/sys/dev/isa/aztech.c @@ -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 @@ az_probe(struct device *parent, struct cfdata *cf, void *aux) 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 @@ az_probe(struct device *parent, struct cfdata *cf, void *aux) 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; - return 1; + + return (r != 0); } void diff --git a/sys/dev/isa/radiotrack.c b/sys/dev/isa/radiotrack.c index 38605cf7f2a2..9342d037f0ee 100644 --- a/sys/dev/isa/radiotrack.c +++ b/sys/dev/isa/radiotrack.c @@ -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 @@ rt_probe(struct device *parent, struct cfdata *cf, void *aux) 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 @@ rt_probe(struct device *parent, struct cfdata *cf, void *aux) 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; - return 1; + + return (r != 0); } void diff --git a/sys/dev/isa/radiotrack2.c b/sys/dev/isa/radiotrack2.c index f082006e4051..e51f9ab27790 100644 --- a/sys/dev/isa/radiotrack2.c +++ b/sys/dev/isa/radiotrack2.c @@ -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 @@ rtii_probe(struct device *parent, struct cfdata *cf, void *aux) 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 @@ rtii_probe(struct device *parent, struct cfdata *cf, void *aux) 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; - return 1; + + return (r != 0); } void diff --git a/sys/dev/isa/sf16fmr2.c b/sys/dev/isa/sf16fmr2.c index a04ebc47521b..14c837cadcc0 100644 --- a/sys/dev/isa/sf16fmr2.c +++ b/sys/dev/isa/sf16fmr2.c @@ -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 @@ sf2r_probe(struct device *parent, struct cfdata *cf, void *aux) 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 @@ sf2r_probe(struct device *parent, struct cfdata *cf, void *aux) 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; - return 1; + + return (r != 0); } void