make dsp_read() assert that it has a read channel, not a write channel

Submitted by:	green
This commit is contained in:
Cameron Grant 2000-01-10 07:05:15 +00:00
parent 78ae73b5ea
commit 898cb2af53
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55721

View File

@ -168,8 +168,8 @@ dsp_read(snddev_info *d, int chan, struct uio *buf, int flag)
if (!(d->flags & SD_F_PRIO_SET)) d->flags |= SD_F_PRIO_RD;
if (!(d->flags & SD_F_DIR_SET)) setchns(d, chan);
getchns(d, chan, &rdch, &wrch);
KASSERT(wrch, ("dsp_read: nonexistant channel"));
KASSERT(wrch->flags & CHN_F_BUSY, ("dsp_read: nonbusy channel"));
KASSERT(rdch, ("dsp_read: nonexistant channel"));
KASSERT(rdch->flags & CHN_F_BUSY, ("dsp_read: nonbusy channel"));
if (rdch->flags & CHN_F_MAPPED) return EINVAL;
if (!(rdch->flags & CHN_F_RUNNING)) {
rdch->flags |= CHN_F_RUNNING;