summaryrefslogtreecommitdiff
path: root/sys/dev/isa/radiotrack.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/radiotrack.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/radiotrack.c')
-rw-r--r--sys/dev/isa/radiotrack.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/sys/dev/isa/radiotrack.c b/sys/dev/isa/radiotrack.c
index fecd185e664..4e66b89c792 100644
--- a/sys/dev/isa/radiotrack.c
+++ b/sys/dev/isa/radiotrack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radiotrack.c,v 1.1 2001/12/05 10:27:06 mickey Exp $ */
+/* $OpenBSD: radiotrack.c,v 1.2 2002/01/02 19:36:50 mickey Exp $ */
/* $RuOBSD: radiotrack.c,v 1.3 2001/10/18 16:51:36 pva Exp $ */
/*
@@ -137,22 +137,22 @@ rt_probe(struct device *parent, void *self, void *aux)
struct isa_attach_args *ia = aux;
bus_space_tag_t iot = ia->ia_iot;
bus_space_handle_t ioh;
-
int iosize = 1, iobase = ia->ia_iobase;
if (!RT_BASE_VALID(iobase)) {
- printf("rt: configured iobase 0x%x invalid", iobase);
- return 0;
+ printf("rt: 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 (!rt_find(iot, ioh))
- return 0;
+ if (!rt_find(iot, ioh)) {
+ bus_space_unmap(iot, ioh, iosize);
+ return (0);
+ }
+ bus_space_unmap(iot, ioh, iosize);
ia->ia_iosize = iosize;
return 1;
}
@@ -172,25 +172,27 @@ rt_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;
+ }
switch (sc->lm.iot) {
case 0x20C:
/* FALLTHROUGH */
case 0x30C:
sc->cardtype = CARD_RADIOTRACK;
- printf(": AIMS Lab Radiotrack or compatible");
+ printf(": AIMS Lab Radiotrack or compatible\n");
break;
case 0x284:
/* FALLTHROUGH */
case 0x384:
sc->cardtype = CARD_SF16FMI;
- printf(": SoundForte RadioX SF16-FMI");
+ printf(": SoundForte RadioX SF16-FMI\n");
break;
default:
sc->cardtype = CARD_UNKNOWN;
- printf(": Unknown card");
+ printf(": Unknown card\n");
break;
}