mirror of
https://github.com/opnsense/src.git
synced 2026-02-19 02:30:08 -05:00
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:
parent
e6e7bf7087
commit
2c53a4bbcb
3 changed files with 6 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue