summaryrefslogtreecommitdiff
path: root/sys/dev/isa/aztech.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-02 19:36:52 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-02 19:36:52 +0000
commit36c51c4085c0eafe65247d71bf34df477a1afd46 (patch)
treec1282824ca3d1aebc846a995a69c57e342a48a2b /sys/dev/isa/aztech.c
parent1f66a61057d0f5e31d3b268f91d35b3e4fc75e40 (diff)
do not unmap io space while it's still in use (in *probe)
missing new lines and replace panics w/ printf+return. idea from netbsd's port.
Diffstat (limited to 'sys/dev/isa/aztech.c')
-rw-r--r--sys/dev/isa/aztech.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/dev/isa/aztech.c b/sys/dev/isa/aztech.c
index ae852097c2b..23898bff686 100644
--- a/sys/dev/isa/aztech.c
+++ b/sys/dev/isa/aztech.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aztech.c,v 1.2 2001/12/05 10:27:06 mickey Exp $ */
+/* $OpenBSD: aztech.c,v 1.3 2002/01/02 19:36:51 mickey Exp $ */
/* $RuOBSD: aztech.c,v 1.11 2001/10/20 13:23:47 pva Exp $ */
/*
@@ -128,20 +128,21 @@ az_probe(struct device *parent, void *self, void *aux)
int iosize = 1, iobase = ia->ia_iobase;
if (!AZ_BASE_VALID(iobase)) {
- printf("az: configured iobase 0x%x invalid", iobase);
- return 0;
+ printf("az: configured iobase 0x%x invalid\n", iobase);
+ return (0);
}
if (bus_space_map(iot, iobase, iosize, 0, &ioh))
- return 0;
-
- bus_space_unmap(iot, ioh, iosize);
+ return (0);
- if (!az_find(iot, ioh))
- return 0;
+ if (!az_find(iot, ioh)) {
+ bus_space_unmap(iot, ioh, iosize);
+ return (0);
+ }
+ bus_space_unmap(iot, ioh, iosize);
ia->ia_iosize = iosize;
- return 1;
+ return (1);
}
void
@@ -159,10 +160,12 @@ az_attach(struct device *parent, struct device *self, void *aux)
/* remap I/O */
if (bus_space_map(sc->lm.iot, ia->ia_iobase, ia->ia_iosize,
- 0, &sc->lm.ioh))
- panic(": bus_space_map() of %s failed", sc->sc_dev.dv_xname);
+ 0, &sc->lm.ioh)) {
+ printf(": bus_space_map() failed\n");
+ return;
+ }
- printf(": Aztech/PackardBell");
+ printf(": Aztech/PackardBell\n");
/* Configure struct lm700x_t lm */
sc->lm.offset = 0;