HomeFreeBSD

sound: Retire midi_devs and mstat_lock

Description

sound: Retire midi_devs and mstat_lock

Nowadays midi_devs only has two uses:

  1. To verify in midi_init() if a given device unit exists, as well as to calculate the next device unit. Instead, make sure we always get a unique unit and channel number using unr(9).
  2. To keep track of all midi devices, so that it can destroy them all at once in midi_sysuninit(). However, since we stopped building midi as a kernel module, there is no reason to do that, simply let the drivers tear down the devices themselves.

Also retire mstat_lock since it's only used to protect midi_devs.

PR: 261071
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54126

Details

Provenance
christosAuthored on Jan 2 2026, 4:56 PM
Differential Revision
D54126: sound: Retire midi_devs and mstat_lock
Parents
rG45bb10e0ed5a: sound: Stop building midi as a module
Branches
Unknown
Tags
Unknown