sound: Convert pcm_chn_add() to void

It always returns 0.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D44998

(cherry picked from commit 139bcec852cf2786ca839ca0bddbb2b78a23d6fa)
This commit is contained in:
Christos Margiolis 2024-05-06 20:27:18 +02:00
parent e6e7bf7087
commit 2c53a4bbcb
3 changed files with 6 additions and 18 deletions

View file

@ -379,7 +379,7 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans,
sysctl_hw_snd_maxautovchans, "I",
"maximum virtual channel");
int
void
pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch)
{
PCM_BUSYASSERT(d);
@ -405,8 +405,6 @@ pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch)
default:
__assert_unreachable();
}
return (0);
}
int
@ -454,7 +452,6 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo)
{
struct snddev_info *d = device_get_softc(dev);
struct pcm_channel *ch;
int err;
PCM_BUSYASSERT(d);
@ -467,15 +464,10 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo)
return (ENODEV);
}
err = pcm_chn_add(d, ch);
pcm_chn_add(d, ch);
PCM_UNLOCK(d);
if (err) {
device_printf(d->dev, "pcm_chn_add(%s) failed, err=%d\n",
ch->name, err);
chn_kill(ch);
}
return (err);
return (0);
}
static void

View file

@ -297,7 +297,7 @@ int pcm_setvchans(struct snddev_info *d, int direction, int newcnt, int num);
int pcm_chnalloc(struct snddev_info *d, struct pcm_channel **ch, int direction,
pid_t pid, char *comm);
int pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch);
void pcm_chn_add(struct snddev_info *d, struct pcm_channel *ch);
int pcm_chn_remove(struct snddev_info *d, struct pcm_channel *ch);
int pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo);

View file

@ -706,13 +706,8 @@ vchan_create(struct pcm_channel *parent, int num)
}
/* add us to our grandparent's channel list */
ret = pcm_chn_add(d, ch);
pcm_chn_add(d, ch);
PCM_UNLOCK(d);
if (ret != 0) {
chn_kill(ch);
CHN_LOCK(parent);
return (ret);
}
CHN_LOCK(parent);
/*
@ -727,6 +722,7 @@ vchan_create(struct pcm_channel *parent, int num)
parent->flags |= CHN_F_HAS_VCHAN;
ret = 0;
parent_caps = chn_getcaps(parent);
if (parent_caps == NULL)
ret = EINVAL;