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
Unknown Object (File)
Thu, Sep 10, 12:52 AM
Unknown Object (File)
Wed, Sep 9, 12:52 PM
Unknown Object (File)
Tue, Sep 8, 9:13 PM
Unknown Object (File)
Tue, Sep 8, 12:44 AM
Unknown Object (File)
Sat, Sep 5, 11:48 PM
Unknown Object (File)
Sat, Sep 5, 6:22 PM
Unknown Object (File)
Sat, Sep 5, 10:36 AM
Unknown Object (File)
Sat, Sep 5, 2:03 AM
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