Page MenuHomeFreeBSD

sound: Simplify how snd_mixer is fetched and how the cdev is created
Needs ReviewPublic

Authored by christos on Fri, Aug 21, 12:41 PM.
Tags
None
Referenced Files
F167972795: D59070.id184636.diff
Tue, Aug 25, 5:05 PM
F167885453: D59070.diff
Tue, Aug 25, 6:15 AM
F167825488: D59070.id.diff
Mon, Aug 24, 7:40 PM
Unknown Object (File)
Mon, Aug 24, 5:56 PM
Unknown Object (File)
Mon, Aug 24, 2:25 PM
Unknown Object (File)
Mon, Aug 24, 1:14 PM
Unknown Object (File)
Sun, Aug 23, 5:31 PM
Unknown Object (File)
Sat, Aug 22, 2:34 PM
Subscribers

Details

Reviewers
markj
emaste
kib
Summary

The primary snd_mixer was reached by accessing the mixer cdev's si_drv1.
This is tedious and ugly, so store the mixer in snddev_info->mixer and
access it directly.

Additionally, create the cdev in a new mixer_make_dev() function (in
similar fashion to dsp_make_dev()) in pcm_register(), when everything is
initialized, instead of risking potential races because mixer_init()
(called before pcm_register()) used to create the cdev.

Also add some NULL checks in pcm_register(), to avoid creating a mixer
cdev when the driver (e.g., fdt/audio_soc.c) does not create a mixer in
the first place, and similarly in pcm_unregister().

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75935
Build 72818: arc lint + arc unit