Commit 9d67a400 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda: Drop NULL check for snd_ctl_remove()

Since snd_ctl_remove() accepts the NULL kcontrol argument now, we can
drop the check in the caller side.

Link: https://lore.kernel.org/20240617100529.6667-5-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4d4500b4
...@@ -207,7 +207,7 @@ void hda_cs_dsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl) ...@@ -207,7 +207,7 @@ void hda_cs_dsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl)
struct hda_cs_dsp_coeff_ctl *ctl = cs_ctl->priv; struct hda_cs_dsp_coeff_ctl *ctl = cs_ctl->priv;
/* ctl and kctl may already have been removed by ALSA private_free */ /* ctl and kctl may already have been removed by ALSA private_free */
if (ctl && ctl->kctl) if (ctl)
snd_ctl_remove(ctl->card, ctl->kctl); snd_ctl_remove(ctl->card, ctl->kctl);
} }
EXPORT_SYMBOL_NS_GPL(hda_cs_dsp_control_remove, SND_HDA_CS_DSP_CONTROLS); EXPORT_SYMBOL_NS_GPL(hda_cs_dsp_control_remove, SND_HDA_CS_DSP_CONTROLS);
......
...@@ -597,17 +597,12 @@ static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda) ...@@ -597,17 +597,12 @@ static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda)
{ {
struct hda_codec *codec = tas_hda->priv->codec; struct hda_codec *codec = tas_hda->priv->codec;
if (tas_hda->dsp_prog_ctl)
snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl);
if (tas_hda->dsp_conf_ctl)
snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl);
for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--) for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--)
if (tas_hda->snd_ctls[i])
snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]);
if (tas_hda->prof_ctl)
snd_ctl_remove(codec->card, tas_hda->prof_ctl); snd_ctl_remove(codec->card, tas_hda->prof_ctl);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment