ALSA: core: Make snd_card_free() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 7 Feb 2023 19:19:07 +0000 (20:19 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 Feb 2023 12:39:27 +0000 (13:39 +0100)
The function returns 0 unconditionally. Make it return void instead and
simplify all callers accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Geoff Levand <geoff@infradead.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230207191907.467756-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/core.h
sound/core/init.c
sound/pci/hda/hda_tegra.c
sound/ppc/snd_ps3.c

index 21884c979c177a069b1d2d40fd7124a81cc1c29f..3edc4ab08774926a661f7dfa6c6d777feb7a0322 100644 (file)
@@ -288,7 +288,7 @@ int snd_devm_card_new(struct device *parent, int idx, const char *xid,
 
 void snd_card_disconnect(struct snd_card *card);
 void snd_card_disconnect_sync(struct snd_card *card);
-int snd_card_free(struct snd_card *card);
+void snd_card_free(struct snd_card *card);
 void snd_card_free_when_closed(struct snd_card *card);
 int snd_card_free_on_error(struct device *dev, int ret);
 void snd_card_set_id(struct snd_card *card, const char *id);
index 6bb3e2b7797196cd96d448fa16eb7238d9b60af8..df0c22480375a558a635d1c8ea1bb74c1ad37fe0 100644 (file)
@@ -632,7 +632,7 @@ EXPORT_SYMBOL(snd_card_free_when_closed);
  * Return: Zero. Frees all associated devices and frees the control
  * interface associated to given soundcard.
  */
-int snd_card_free(struct snd_card *card)
+void snd_card_free(struct snd_card *card)
 {
        DECLARE_COMPLETION_ONSTACK(released);
 
@@ -643,15 +643,13 @@ int snd_card_free(struct snd_card *card)
         * the check here at the beginning.
         */
        if (card->releasing)
-               return 0;
+               return;
 
        card->release_completion = &released;
        snd_card_free_when_closed(card);
 
        /* wait, until all devices are ready for the free operation */
        wait_for_completion(&released);
-
-       return 0;
 }
 EXPORT_SYMBOL(snd_card_free);
 
index 976a112c7d0061c932c82310b376bacf381fc2c8..c2bf867818946554c5dcf549174fdd79e121c112 100644 (file)
@@ -582,12 +582,10 @@ static void hda_tegra_probe_work(struct work_struct *work)
 
 static int hda_tegra_remove(struct platform_device *pdev)
 {
-       int ret;
-
-       ret = snd_card_free(dev_get_drvdata(&pdev->dev));
+       snd_card_free(dev_get_drvdata(&pdev->dev));
        pm_runtime_disable(&pdev->dev);
 
-       return ret;
+       return 0;
 }
 
 static void hda_tegra_shutdown(struct platform_device *pdev)
index 631a61ce52f4e3c73b18e1dd1ab451bd8d54f03a..8d349231205e75071b6c5f7f445d0d2d96f6dbf6 100644 (file)
@@ -1053,9 +1053,7 @@ static void snd_ps3_driver_remove(struct ps3_system_bus_device *dev)
         * ctl and preallocate buffer will be freed in
         * snd_card_free
         */
-       ret = snd_card_free(the_card.card);
-       if (ret)
-               pr_info("%s: ctl freecard=%d\n", __func__, ret);
+       snd_card_free(the_card.card);
 
        dma_free_coherent(&dev->core,
                          PAGE_SIZE,