Skip to content

Commit 25a5a77

Browse files
Uwe Kleine-Königtiwai
authored andcommitted
ALSA: core: Make snd_card_free() return void
The function returns 0 unconditionally. Make it return void instead and simplify all callers accordingly. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Acked-by: Geoff Levand <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 73c5685 commit 25a5a77

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

include/sound/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int snd_devm_card_new(struct device *parent, int idx, const char *xid,
288288

289289
void snd_card_disconnect(struct snd_card *card);
290290
void snd_card_disconnect_sync(struct snd_card *card);
291-
int snd_card_free(struct snd_card *card);
291+
void snd_card_free(struct snd_card *card);
292292
void snd_card_free_when_closed(struct snd_card *card);
293293
int snd_card_free_on_error(struct device *dev, int ret);
294294
void snd_card_set_id(struct snd_card *card, const char *id);

sound/core/init.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ EXPORT_SYMBOL(snd_card_free_when_closed);
632632
* Return: Zero. Frees all associated devices and frees the control
633633
* interface associated to given soundcard.
634634
*/
635-
int snd_card_free(struct snd_card *card)
635+
void snd_card_free(struct snd_card *card)
636636
{
637637
DECLARE_COMPLETION_ONSTACK(released);
638638

@@ -643,15 +643,13 @@ int snd_card_free(struct snd_card *card)
643643
* the check here at the beginning.
644644
*/
645645
if (card->releasing)
646-
return 0;
646+
return;
647647

648648
card->release_completion = &released;
649649
snd_card_free_when_closed(card);
650650

651651
/* wait, until all devices are ready for the free operation */
652652
wait_for_completion(&released);
653-
654-
return 0;
655653
}
656654
EXPORT_SYMBOL(snd_card_free);
657655

sound/pci/hda/hda_tegra.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,10 @@ static void hda_tegra_probe_work(struct work_struct *work)
582582

583583
static int hda_tegra_remove(struct platform_device *pdev)
584584
{
585-
int ret;
586-
587-
ret = snd_card_free(dev_get_drvdata(&pdev->dev));
585+
snd_card_free(dev_get_drvdata(&pdev->dev));
588586
pm_runtime_disable(&pdev->dev);
589587

590-
return ret;
588+
return 0;
591589
}
592590

593591
static void hda_tegra_shutdown(struct platform_device *pdev)

sound/ppc/snd_ps3.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,9 +1053,7 @@ static void snd_ps3_driver_remove(struct ps3_system_bus_device *dev)
10531053
* ctl and preallocate buffer will be freed in
10541054
* snd_card_free
10551055
*/
1056-
ret = snd_card_free(the_card.card);
1057-
if (ret)
1058-
pr_info("%s: ctl freecard=%d\n", __func__, ret);
1056+
snd_card_free(the_card.card);
10591057

10601058
dma_free_coherent(&dev->core,
10611059
PAGE_SIZE,

0 commit comments

Comments
 (0)