sound: Do not create root feeder in chn_init()

The feeder chain gets destroyed when feeder_chain() is called, which is
after the chn_reset() call in chn_init() further down for primary chans,
or vchan_create() for vchans. This makes the root feeder creation in
chn_init() essentially a no-op. Remove it altogether and let
feeder_chain() after chn_reset() take care of creating the feeder
properly. It creates the root one as well.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55941
This commit is contained in:
Christos Margiolis
2026-03-24 11:31:43 +01:00
parent 6755f558c1
commit b9f9fc473e
-12
View File
@@ -1144,7 +1144,6 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
int dir, void *devinfo)
{
struct pcm_channel *c;
struct feeder_class *fc;
struct snd_dbuf *b, *bs;
char buf[CHN_NAMELEN];
int err, i, direction, *vchanrate, *vchanformat;
@@ -1217,17 +1216,6 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
chn_vpc_reset(c, SND_VOL_C_PCM, 1);
CHN_UNLOCK(c);
fc = feeder_getclass(FEEDER_ROOT);
if (fc == NULL) {
device_printf(d->dev, "%s(): failed to get feeder class\n",
__func__);
goto fail;
}
if (feeder_add(c, fc, NULL)) {
device_printf(d->dev, "%s(): failed to add feeder\n", __func__);
goto fail;
}
b = sndbuf_create(c, "primary");
bs = sndbuf_create(c, "secondary");
if (b == NULL || bs == NULL) {