diff options
author | Takashi Iwai <[email protected]> | 2024-06-17 12:05:26 +0200 |
---|---|---|
committer | Takashi Iwai <[email protected]> | 2024-06-18 12:54:08 +0200 |
commit | 9d67a4006f7219577c5c4502d43892feb8773aa6 (patch) | |
tree | 63f6d7901bbcdb503ec55e3b7d6b5aa1ae306340 | |
parent | 4d4500b4396a226d159b2633b091c0b65509b24a (diff) |
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
-rw-r--r-- | sound/pci/hda/hda_cs_dsp_ctl.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/tas2781_hda_i2c.c | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_cs_dsp_ctl.c b/sound/pci/hda/hda_cs_dsp_ctl.c index e6e876998e71..deb74c247082 100644 --- a/sound/pci/hda/hda_cs_dsp_ctl.c +++ b/sound/pci/hda/hda_cs_dsp_ctl.c @@ -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; /* 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); } EXPORT_SYMBOL_NS_GPL(hda_cs_dsp_control_remove, SND_HDA_CS_DSP_CONTROLS); diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index d7af4fd10714..879d4b48e6c7 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -597,18 +597,13 @@ static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda) { struct hda_codec *codec = tas_hda->priv->codec; - if (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_prog_ctl); + snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); 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); } static void tasdev_fw_ready(const struct firmware *fmw, void *context) |