ALSA: sh: aica: Drop if blocks with always false condition
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 15 Mar 2023 15:04:53 +0000 (16:04 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 20 Mar 2023 13:06:58 +0000 (13:06 +0000)
snd_aica_remove() is only called after a successful call to
snd_aica_probe(). With the latter it's sure that platform_set_drvdata()
was called with a non-NULL argument. So platform_get_drvdata() won't return
NULL and the check can be dropped.

This prepares converting platform driver remove callbacks to return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/sh/aica.c

index 6e9d6bd..459c907 100644 (file)
@@ -543,8 +543,6 @@ static int snd_aica_remove(struct platform_device *devptr)
 {
        struct snd_card_aica *dreamcastcard;
        dreamcastcard = platform_get_drvdata(devptr);
-       if (unlikely(!dreamcastcard))
-               return -ENODEV;
        snd_card_free(dreamcastcard->card);
        kfree(dreamcastcard);
        return 0;