[PATCH v4 05/22] ASoC: ops: Introduce 'snd_soc_ctl_activate'
Mark Brown
broonie at kernel.org
Mon Nov 9 12:59:38 PST 2026
> This function mirrors wraps the sound/core 'snd_ctl_activate_id'
> for ASoC. Machine drivers may call it to lock down kcontrols
> during fixup_controls.
> +int snd_soc_ctl_activate(struct snd_soc_card *card,
> + const char *name, int active)
> +{
> + struct snd_kcontrol *kctl;
> + int ret = -EINVAL;
> + kctl = snd_soc_card_get_kcontrol(card, name);
> +
> + if (kctl) {
> + ret = snd_ctl_activate_id(card->snd_card, &kctl->id, active);
> + if (ret < 0)
As Cezary pointed out this return is redundant, we could just exit above
if there's no kctl.
--
Mark Brown <broonie at kernel.org>
More information about the Linux-mediatek
mailing list