Commit 1892a991 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Mark Brown

ASoC: core: Make snd_soc_unregister_card() return void

The function snd_soc_unregister_card() returned 0 unconditionally and most
callers don't care to check the return value. Make it return void and
adapt the callers that didn't ignore the return value before.

This is a preparation for making platform remove callbacks return void.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220621145834.198519-1-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 644ed467
...@@ -426,7 +426,7 @@ enum snd_soc_pcm_subclass { ...@@ -426,7 +426,7 @@ enum snd_soc_pcm_subclass {
}; };
int snd_soc_register_card(struct snd_soc_card *card); int snd_soc_register_card(struct snd_soc_card *card);
int snd_soc_unregister_card(struct snd_soc_card *card); void snd_soc_unregister_card(struct snd_soc_card *card);
int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card); int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
int snd_soc_suspend(struct device *dev); int snd_soc_suspend(struct device *dev);
......
...@@ -157,7 +157,9 @@ static int snd_proto_probe(struct platform_device *pdev) ...@@ -157,7 +157,9 @@ static int snd_proto_probe(struct platform_device *pdev)
static int snd_proto_remove(struct platform_device *pdev) static int snd_proto_remove(struct platform_device *pdev)
{ {
return snd_soc_unregister_card(&snd_proto); snd_soc_unregister_card(&snd_proto);
return 0;
} }
static const struct of_device_id snd_proto_of_match[] = { static const struct of_device_id snd_proto_of_match[] = {
......
...@@ -113,12 +113,11 @@ static int pcm030_fabric_probe(struct platform_device *op) ...@@ -113,12 +113,11 @@ static int pcm030_fabric_probe(struct platform_device *op)
static int pcm030_fabric_remove(struct platform_device *op) static int pcm030_fabric_remove(struct platform_device *op)
{ {
struct pcm030_audio_data *pdata = platform_get_drvdata(op); struct pcm030_audio_data *pdata = platform_get_drvdata(op);
int ret;
ret = snd_soc_unregister_card(pdata->card); snd_soc_unregister_card(pdata->card);
platform_device_unregister(pdata->codec_device); platform_device_unregister(pdata->codec_device);
return ret; return 0;
} }
static const struct of_device_id pcm030_audio_match[] = { static const struct of_device_id pcm030_audio_match[] = {
......
...@@ -2319,14 +2319,12 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card); ...@@ -2319,14 +2319,12 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card);
* @card: Card to unregister * @card: Card to unregister
* *
*/ */
int snd_soc_unregister_card(struct snd_soc_card *card) void snd_soc_unregister_card(struct snd_soc_card *card)
{ {
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
snd_soc_unbind_card(card, true); snd_soc_unbind_card(card, true);
mutex_unlock(&client_mutex); mutex_unlock(&client_mutex);
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name); dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
return 0;
} }
EXPORT_SYMBOL_GPL(snd_soc_unregister_card); EXPORT_SYMBOL_GPL(snd_soc_unregister_card);
......
...@@ -271,9 +271,7 @@ static void snd_soc_tplg_test_load_with_null_comp(struct kunit *test) ...@@ -271,9 +271,7 @@ static void snd_soc_tplg_test_load_with_null_comp(struct kunit *test)
KUNIT_EXPECT_EQ(test, 0, ret); KUNIT_EXPECT_EQ(test, 0, ret);
/* cleanup */ /* cleanup */
ret = snd_soc_unregister_card(&kunit_comp->card); snd_soc_unregister_card(&kunit_comp->card);
KUNIT_EXPECT_EQ(test, 0, ret);
snd_soc_unregister_component(test_dev); snd_soc_unregister_component(test_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment