From 436c9b651a9f5b60dee5ab5b577eb1460a418cf1 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Fri, 25 Jan 2002 04:14:12 +0000 Subject: [PATCH] Fix code that had rotted behind debugging macros. Approved by: cg (in principle) MFC after: 2 weeks --- sys/dev/sound/isa/ess.c | 2 +- sys/dev/sound/isa/sb16.c | 2 +- sys/dev/sound/isa/sb8.c | 2 +- sys/dev/sound/pcm/buffer.c | 2 +- sys/dev/sound/pcm/channel.c | 6 +++--- sys/dev/sound/pcm/channel.h | 1 + sys/dev/sound/pcm/dsp.c | 2 +- sys/dev/sound/pcm/sound.c | 1 + 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index 624f81caf200..48b62882f353 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -270,7 +270,7 @@ ess_reset_dsp(struct ess_info *sc) ess_wr(sc, SBDSP_RST, 0); if (ess_get_byte(sc) != 0xAA) { DEB(printf("ess_reset_dsp 0x%lx failed\n", - rman_get_start(d->io_base))); + rman_get_start(sc->io_base))); return ENXIO; /* Sorry */ } ess_cmd(sc, 0xc6); diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index 7aef4e3d9218..94e5f912bad9 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -272,7 +272,7 @@ sb_reset_dsp(struct sb_info *sb) sb_unlock(sb); if (b != 0xAA) { DEB(printf("sb_reset_dsp 0x%lx failed\n", - rman_get_start(d->io_base))); + rman_get_start(sb->io_base))); return ENXIO; /* Sorry */ } return 0; diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index e8b201165590..be4e6708dbb7 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -246,7 +246,7 @@ sb_reset_dsp(struct sb_info *sb) sb_wr(sb, SBDSP_RST, 0); if (sb_get_byte(sb) != 0xAA) { DEB(printf("sb_reset_dsp 0x%lx failed\n", - rman_get_start(d->io_base))); + rman_get_start(sb->io_base))); return ENXIO; /* Sorry */ } return 0; diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 8e00e62007a0..1081fdfa3dae 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -619,7 +619,7 @@ sndbuf_isadma(struct snd_dbuf *b, int go) DEB(printf("buf 0x%p ISA DMA %s, channel %d\n", b, (go == PCMTRIG_START)? "started" : "stopped", - b->chan)); + b->isadmachan)); } int diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index df1826134bf5..5789a3d0a414 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -156,7 +156,7 @@ chn_dmaupdate(struct pcm_channel *c) DEB( if (delta >= ((sndbuf_getsize(b) * 15) / 16)) { if (!(c->flags & (CHN_F_CLOSING | CHN_F_ABORTING))) - device_printf(c->parentsnddev->dev, "hwptr went backwards %d -> %d\n", old, hwptr); + device_printf(c->dev, "hwptr went backwards %d -> %d\n", old, hwptr); } ); @@ -257,13 +257,13 @@ chn_write(struct pcm_channel *c, struct uio *buf) * the write operation avoids blocking. */ if ((c->flags & CHN_F_NBIO) && buf->uio_resid > sndbuf_getblksz(bs)) { - DEB(device_printf(c->parentsnddev->dev, "broken app, nbio and tried to write %d bytes with fragsz %d\n", + DEB(device_printf(c->dev, "broken app, nbio and tried to write %d bytes with fragsz %d\n", buf->uio_resid, sndbuf_getblksz(bs))); newsize = 16; while (newsize < min(buf->uio_resid, CHN_2NDBUFMAXSIZE / 2)) newsize <<= 1; chn_setblocksize(c, sndbuf_getblkcnt(bs), newsize); - DEB(device_printf(c->parentsnddev->dev, "frags reset to %d x %d\n", sndbuf_getblkcnt(bs), sndbuf_getblksz(bs))); + DEB(device_printf(c->dev, "frags reset to %d x %d\n", sndbuf_getblkcnt(bs), sndbuf_getblksz(bs))); } ret = 0; diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index cc3a3ea746a0..87149a5a75d5 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -60,6 +60,7 @@ struct pcm_channel { struct snddev_info *parentsnddev; struct pcm_channel *parentchannel; void *devinfo; + device_t dev; char name[CHN_NAMELEN]; void *lock; SLIST_HEAD(, pcmchan_children) children; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 2f1462cfc5c9..b7eb4b9e5c96 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -966,7 +966,7 @@ dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td) case SOUND_PCM_READ_FILTER: /* dunno what these do, don't sound important */ default: - DEB(printf("default ioctl chan%d fn 0x%08lx fail\n", chan, cmd)); + DEB(printf("default ioctl fn 0x%08lx fail\n", cmd)); ret = EINVAL; break; } diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 94065bcff5b8..cbd1bc19646b 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -379,6 +379,7 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c ch->pid = -1; ch->parentsnddev = d; ch->parentchannel = parent; + ch->dev = d->dev; snprintf(ch->name, 32, "%s:%s:%d", device_get_nameunit(d->dev), dirs, ch->num); err = chn_init(ch, devinfo, dir);