Page MenuHomeFreeBSD

sound: Embed mixer cdev in snd_mixer
ClosedPublic

Authored by christos on Aug 21 2026, 12:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 5, 8:56 AM
Unknown Object (File)
Sun, Oct 4, 2:37 PM
Unknown Object (File)
Sun, Oct 4, 2:34 PM
Unknown Object (File)
Sat, Oct 3, 8:51 PM
Unknown Object (File)
Sat, Oct 3, 1:20 PM
Unknown Object (File)
Sat, Oct 3, 1:33 AM
Unknown Object (File)
Sat, Oct 3, 12:39 AM
Unknown Object (File)
Fri, Oct 2, 11:37 AM
Subscribers

Details

Summary

The mixer cdev belongs to the mixer, not to the PCM device, so move it
from snddev_info->mixer_dev into a new snd_mixer->cdev field. snd_mixer
itself is now included in snddev_info.

Also add a MIXER_REGISTERED() macro similar to PCM_REGISTERED().

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/sound/pcm/mixer.c
719

Do you need to clear m->cdev? What is the lifetime for struct snd_mixer?

sys/dev/sound/pcm/mixer.c
719

snd_mixer gets freed in this function here, which is called by pcm_unregister() during detach. I think we should be fine and not NULL it.

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Sep 18, 6:19 PM
This revision was automatically updated to reflect the committed changes.