HomeFreeBSD

sound: Simplify logic in dsp_io_ops()

Description

sound: Simplify logic in dsp_io_ops()

Use CHN_LOCK()/CHN_UNLOCK() directly, instead of
dsp_lock_chans()/dsp_unlock_chans(). These functions are useful when we
want to potentially lock both channels. Here we know which channel we
are locking, so we can just lock it directly. This way we get rid of the
prio variable as well.

Related to runpid again, there is no reason to assign it when
CHN_F_RUNNING is not set. channel->pid (as well as channel->comm) is
always assigned in dsp_chn_alloc().

Get rid of runpid. I do not see how we can end up with channel->pid
(td->td_proc->p_pid) not matching buf->uio_td->td_proc->p_pid.

Also improve errno values.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D53736

Details

Provenance
christosAuthored on Nov 21 2025, 4:14 PM
Reviewer
markj
Differential Revision
D53736: sound: Simplify logic in dsp_io_ops()
Parents
rGe13664f6a44b: dmesg.8: Index kern.msgbuf_show_timestamp
Branches
Unknown
Tags
Unknown