diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1998-05-13 10:25:14 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1998-05-13 10:25:14 +0000 |
commit | 775f6975fc59e6ee639af4cb9aa6094787a07cb1 (patch) | |
tree | dcaa0c57d513b87aabc29a8c0f573befaf686714 | |
parent | 00a1408bad542815e298d021bf2c2e5782e2210b (diff) |
don't printf in probe routines.
-rw-r--r-- | sys/dev/isa/gus.c | 8 | ||||
-rw-r--r-- | sys/dev/isa/pas.c | 20 | ||||
-rw-r--r-- | sys/dev/isa/pss.c | 22 | ||||
-rw-r--r-- | sys/dev/isa/sb.c | 66 |
4 files changed, 60 insertions, 56 deletions
diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index 6ba8eaa4046..cec95c396a1 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gus.c,v 1.15 1998/05/08 18:37:21 csapuntz Exp $ */ +/* $OpenBSD: gus.c,v 1.16 1998/05/13 10:25:13 provos Exp $ */ /* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */ /*- @@ -691,18 +691,18 @@ gusprobe(parent, match, aux) /* XXX range check before indexing!! */ if (ia->ia_irq == IRQUNK || gus_irq_map[ia->ia_irq] == IRQUNK) { - printf("gus: invalid irq %d, card not probed\n", ia->ia_irq); + DPRINTF(("gus: invalid irq %d, card not probed\n", ia->ia_irq)); return 0; } if (ia->ia_drq == DRQUNK || gus_drq_map[ia->ia_drq] == DRQUNK) { - printf("gus: invalid drq %d, card not probed\n", ia->ia_drq); + DPRINTF(("gus: invalid drq %d, card not probed\n", ia->ia_drq)); return 0; } if (recdrq != DRQUNK) { if (recdrq > 7 || gus_drq_map[recdrq] == DRQUNK) { - printf("gus: invalid second DMA channel (%d), card not probed\n", recdrq); + DPRINTF(("gus: invalid second DMA channel (%d), card not probed\n", recdrq)); return 0; } } else diff --git a/sys/dev/isa/pas.c b/sys/dev/isa/pas.c index 772bcf8d431..058236a37b2 100644 --- a/sys/dev/isa/pas.c +++ b/sys/dev/isa/pas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pas.c,v 1.15 1998/04/26 21:02:51 provos Exp $ */ +/* $OpenBSD: pas.c,v 1.16 1998/05/13 10:25:11 provos Exp $ */ /* $NetBSD: pas.c,v 1.37 1998/01/12 09:43:43 thorpej Exp $ */ /* @@ -268,7 +268,7 @@ pasprobe(parent, match, aux) /* ensure we can set this up as a sound blaster */ if (!SB_BASE_VALID(ia->ia_iobase)) { - printf("pas: configured SB iobase 0x%x invalid\n", ia->ia_iobase); + DPRINTF(("pas: configured SB iobase 0x%x invalid\n", ia->ia_iobase)); return 0; } @@ -287,7 +287,7 @@ pasprobe(parent, match, aux) /* XXX Need to setup pseudo device */ /* XXX What are good io addrs ? */ if (iobase != PAS_DEFAULT_BASE) { - printf("pas: configured iobase %d invalid\n", iobase); + DPRINTF(("pas: configured iobase %d invalid\n", iobase)); return 0; } #else @@ -318,7 +318,7 @@ pasprobe(parent, match, aux) if (t != id) { /* Not a PAS2 */ - printf("pas: detected card but PAS2 test failed\n"); + DPRINTF(("pas: detected card but PAS2 test failed\n")); return 0; } /*XXX*/ @@ -334,7 +334,7 @@ pasprobe(parent, match, aux) if (sc->model >= 0) { if (ia->ia_irq == IRQUNK) { - printf("pas: sb emulation requires known irq\n"); + DPRINTF(("pas: sb emulation requires known irq\n")); return (0); } pasconf(sc->model, ia->ia_iobase, ia->ia_irq, 1); @@ -353,8 +353,8 @@ pasprobe(parent, match, aux) /* Map i/o space [we map 24 ports which is the max of the sb and pro */ if (bus_space_map(sc->sc_sbdsp.sc_iot, ia->ia_iobase, SBP_NPORT, 0, &sc->sc_sbdsp.sc_ioh)) { - printf("pas: can't map i/o space 0x%x/%d in probe\n", - ia->ia_iobase, SBP_NPORT); + DPRINTF(("pas: can't map i/o space 0x%x/%d in probe\n", + ia->ia_iobase, SBP_NPORT)); return 0; } @@ -367,7 +367,7 @@ pasprobe(parent, match, aux) * Cannot auto-discover DMA channel. */ if (!SB_DRQ_VALID(ia->ia_drq)) { - printf("pas: configured dma chan %d invalid\n", ia->ia_drq); + DPRINTF(("pas: configured dma chan %d invalid\n", ia->ia_drq)); goto unmap; } #ifdef NEWCONFIG @@ -378,13 +378,13 @@ pasprobe(parent, match, aux) ia->ia_irq = isa_discoverintr(pasforceintr, aux); sbdsp_reset(&sc->sc_sbdsp); if (!SB_IRQ_VALID(ia->ia_irq)) { - printf("pas: couldn't auto-detect interrupt"); + DPRINTF(("pas: couldn't auto-detect interrupt")); goto unmap; } } else #endif if (!SB_IRQ_VALID(ia->ia_irq)) { - printf("pas: configured irq chan %d invalid\n", ia->ia_irq); + DPRINTF(("pas: configured irq chan %d invalid\n", ia->ia_irq)); goto unmap; } diff --git a/sys/dev/isa/pss.c b/sys/dev/isa/pss.c index 8f907a9c456..5258451ffc2 100644 --- a/sys/dev/isa/pss.c +++ b/sys/dev/isa/pss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pss.c,v 1.14 1998/05/08 18:37:22 csapuntz Exp $ */ +/* $OpenBSD: pss.c,v 1.15 1998/05/13 10:25:07 provos Exp $ */ /* $NetBSD: pss.c,v 1.38 1998/01/12 09:43:44 thorpej Exp $ */ /* @@ -726,7 +726,7 @@ pssprobe(parent, self, aux) int iobase = ia->ia_iobase; if (!PSS_BASE_VALID(iobase)) { - printf("pss: configured iobase %x invalid\n", iobase); + DPRINTF(("pss: configured iobase %x invalid\n", iobase)); return 0; } @@ -770,24 +770,24 @@ pss_found: break; } if (i == 16) { - printf("pss: unable to locate free IRQ channel\n"); + DPRINTF(("pss: unable to locate free IRQ channel\n")); return 0; } else { ia->ia_irq = i; - printf("pss: found IRQ %d free\n", i); + DPRINTF(("pss: found IRQ %d free\n", i)); } } else { if (pss_testirq(sc, ia->ia_irq) == 0) { - printf("pss: configured IRQ unavailable (%d)\n", ia->ia_irq); + DPRINTF(("pss: configured IRQ unavailable (%d)\n", ia->ia_irq)); return 0; } } /* XXX Need to deal with DRQUNK */ if (pss_testdma(sc, ia->ia_drq) == 0) { - printf("pss: configured DMA channel unavailable (%d)\n", ia->ia_drq); + DPRINTF(("pss: configured DMA channel unavailable (%d)\n", ia->ia_drq)); return 0; } @@ -851,7 +851,7 @@ spprobe(parent, match, aux) } } if (i == 12) { - printf("sp: unable to locate free IRQ for WSS\n"); + DPRINTF(("sp: unable to locate free IRQ for WSS\n")); return 0; } else { @@ -863,7 +863,7 @@ spprobe(parent, match, aux) else { sc->sc_irq = cf->cf_irq; if (pss_testirq(pc, sc->sc_irq) == 0) { - printf("sp: configured IRQ unavailable (%d)\n", sc->sc_irq); + DPRINTF(("sp: configured IRQ unavailable (%d)\n", sc->sc_irq)); return 0; } } @@ -877,7 +877,7 @@ spprobe(parent, match, aux) } } if (i == 4) { - printf("sp: unable to locate free DMA channel for WSS\n"); + DPRINTF(("sp: unable to locate free DMA channel for WSS\n")); return 0; } else { @@ -887,7 +887,7 @@ spprobe(parent, match, aux) } else { if (pss_testdma(pc, sc->sc_drq) == 0) { - printf("sp: configured DMA channel unavailable (%d)\n", sc->sc_drq); + DPRINTF(("sp: configured DMA channel unavailable (%d)\n", sc->sc_drq)); return 0; } sc->sc_drq = cf->cf_drq; @@ -896,7 +896,7 @@ spprobe(parent, match, aux) /* Set WSS config registers */ if ((bits = wss_interrupt_bits[sc->sc_irq]) == 0xff) { - printf("sp: invalid interrupt configuration (irq=%d)\n", sc->sc_irq); + DPRINTF(("sp: invalid interrupt configuration (irq=%d)\n", sc->sc_irq)); return 0; } diff --git a/sys/dev/isa/sb.c b/sys/dev/isa/sb.c index 06274862b28..34e777bf15b 100644 --- a/sys/dev/isa/sb.c +++ b/sys/dev/isa/sb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sb.c,v 1.14 1998/04/26 21:02:56 provos Exp $ */ +/* $OpenBSD: sb.c,v 1.15 1998/05/13 10:25:10 provos Exp $ */ /* $NetBSD: sb.c,v 1.57 1998/01/12 09:43:46 thorpej Exp $ */ /* @@ -101,6 +101,13 @@ struct audio_hw_if sb_hw_if = { sbdsp_get_props, }; +#ifdef AUDIO_DEBUG +#define DPRINTF(x) if (sbdebug) printf x +int sbdebug = 0; +#else +#define DPRINTF(x) +#endif + /* * Probe / attach routines. */ @@ -126,14 +133,14 @@ sbmatch(sc) */ if (ISSBPROCLASS(sc)) { if (!SBP_DRQ_VALID(sc->sc_drq8)) { - printf("%s: configured dma chan %d invalid\n", - sc->sc_dev.dv_xname, sc->sc_drq8); + DPRINTF(("%s: configured dma chan %d invalid\n", + sc->sc_dev.dv_xname, sc->sc_drq8)); return 0; } } else { if (!SB_DRQ_VALID(sc->sc_drq8)) { - printf("%s: configured dma chan %d invalid\n", - sc->sc_dev.dv_xname, sc->sc_drq8); + DPRINTF(("%s: configured dma chan %d invalid\n", + sc->sc_dev.dv_xname, sc->sc_drq8)); return 0; } } @@ -150,8 +157,8 @@ sbmatch(sc) if (sc->sc_drq16 == -1) sc->sc_drq16 = sc->sc_drq8; if (!SB16_DRQ_VALID(sc->sc_drq16)) { - printf("%s: configured dma chan %d invalid\n", - sc->sc_dev.dv_xname, sc->sc_drq16); + DPRINTF(("%s: configured dma chan %d invalid\n", + sc->sc_dev.dv_xname, sc->sc_drq16)); return 0; } } else @@ -166,15 +173,13 @@ sbmatch(sc) sbdsp_reset(sc); if (ISSBPROCLASS(sc)) { if (!SBP_IRQ_VALID(sc->sc_irq)) { - printf("%s: couldn't auto-detect interrupt\n", - sc->sc_dev.dv_xname); + DPRINTF(("%s: couldn't auto-detect interrupt\n", sc->sc_dev.dv_xname)); return 0; } } else { if (!SB_IRQ_VALID(sc->sc_irq)) { - printf("%s: couldn't auto-detect interrupt\n"); - sc->sc_dev.dv_xname); + DPRINTF(("%s: couldn't auto-detect interrupt\n", sc->sc_dev.dv_xname)); return 0; } } @@ -182,14 +187,14 @@ sbmatch(sc) #endif if (ISSBPROCLASS(sc)) { if (!SBP_IRQ_VALID(sc->sc_irq)) { - printf("%s: configured irq %d invalid\n", - sc->sc_dev.dv_xname, sc->sc_irq); + DPRINTF(("%s: configured irq %d invalid\n", + sc->sc_dev.dv_xname, sc->sc_irq)); return 0; } } else { if (!SB_IRQ_VALID(sc->sc_irq)) { - printf("%s: configured irq %d invalid\n", - sc->sc_dev.dv_xname, sc->sc_irq); + DPRINTF(("%s: configured irq %d invalid\n", + sc->sc_dev.dv_xname, sc->sc_irq)); return 0; } } @@ -197,41 +202,40 @@ sbmatch(sc) if (ISSB16CLASS(sc)) { int w, r; #if 0 - printf("%s: old drq conf %02x\n", sc->sc_dev.dv_xname, - sbdsp_mix_read(sc, SBP_SET_DRQ)); - printf("%s: try drq conf %02x\n", sc->sc_dev.dv_xname, - drq_conf[sc->sc_drq16] | drq_conf[sc->sc_drq8]); + DPRINTF(("%s: old drq conf %02x\n", sc->sc_dev.dv_xname, + sbdsp_mix_read(sc, SBP_SET_DRQ))); + DPRINTF(("%s: try drq conf %02x\n", sc->sc_dev.dv_xname, + drq_conf[sc->sc_drq16] | drq_conf[sc->sc_drq8])); #endif w = drq_conf[sc->sc_drq16] | drq_conf[sc->sc_drq8]; sbdsp_mix_write(sc, SBP_SET_DRQ, w); r = sbdsp_mix_read(sc, SBP_SET_DRQ) & 0xeb; if (r != w) { - printf("%s: setting drq mask %02x failed, got %02x\n", - sc->sc_dev.dv_xname, w, r); + DPRINTF(("%s: setting drq mask %02x failed, got %02x\n", sc->sc_dev.dv_xname, w, r)); return 0; } #if 0 - printf("%s: new drq conf %02x\n", sc->sc_dev.dv_xname, - sbdsp_mix_read(sc, SBP_SET_DRQ)); + DPRINTF(("%s: new drq conf %02x\n", sc->sc_dev.dv_xname, + sbdsp_mix_read(sc, SBP_SET_DRQ))); #endif #if 0 - printf("%s: old irq conf %02x\n", sc->sc_dev.dv_xname, - sbdsp_mix_read(sc, SBP_SET_IRQ)); - printf("%s: try irq conf %02x\n", sc->sc_dev.dv_xname, - irq_conf[sc->sc_irq]); + DPRINTF(("%s: old irq conf %02x\n", sc->sc_dev.dv_xname, + sbdsp_mix_read(sc, SBP_SET_IRQ))); + DPRINTF(("%s: try irq conf %02x\n", sc->sc_dev.dv_xname, + irq_conf[sc->sc_irq])); #endif w = irq_conf[sc->sc_irq]; sbdsp_mix_write(sc, SBP_SET_IRQ, w); r = sbdsp_mix_read(sc, SBP_SET_IRQ) & 0x0f; if (r != w) { - printf("%s: setting irq mask %02x failed, got %02x\n", - sc->sc_dev.dv_xname, w, r); + DPRINTF(("%s: setting irq mask %02x failed, got %02x\n", + sc->sc_dev.dv_xname, w, r)); return 0; } #if 0 - printf("%s: new irq conf %02x\n", sc->sc_dev.dv_xname, - sbdsp_mix_read(sc, SBP_SET_IRQ)); + DPRINTF(("%s: new irq conf %02x\n", sc->sc_dev.dv_xname, + sbdsp_mix_read(sc, SBP_SET_IRQ))); #endif } |