]> www.infradead.org Git - users/hch/configfs.git/commitdiff
ALSA: spi: Drop NULL check for snd_ctl_remove()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Jun 2024 10:05:27 +0000 (12:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Jun 2024 10:54:34 +0000 (12:54 +0200)
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-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/spi/at73c213.c

index 5648d744aa79ff4a92e0bfe5b50fe60d704305ca..8f6929ced2c8a659726b3a2937319471d5ea3d9b 100644 (file)
@@ -726,12 +726,8 @@ static int snd_at73c213_mixer(struct snd_at73c213 *chip)
        return 0;
 
 cleanup:
-       for (idx = 1; idx < ARRAY_SIZE(snd_at73c213_controls) + 1; idx++) {
-               struct snd_kcontrol *kctl;
-               kctl = snd_ctl_find_numid(card, idx);
-               if (kctl)
-                       snd_ctl_remove(card, kctl);
-       }
+       for (idx = 1; idx < ARRAY_SIZE(snd_at73c213_controls) + 1; idx++)
+               snd_ctl_remove(card, snd_ctl_find_numid(card, idx));
        return errval;
 }