[PATCH] ASoC: core: Make snd_soc_unregister_card() return void
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Tue Jun 21 16:58:34 CEST 2022
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: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
include/sound/soc.h | 2 +-
sound/soc/atmel/mikroe-proto.c | 4 +++-
sound/soc/fsl/pcm030-audio-fabric.c | 5 ++---
sound/soc/soc-core.c | 4 +---
sound/soc/soc-topology-test.c | 4 +---
5 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f20f5f890794..adcc756fe0c2 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -416,7 +416,7 @@ enum snd_soc_pcm_subclass {
};
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);
#ifdef CONFIG_PM_SLEEP
int snd_soc_suspend(struct device *dev);
diff --git a/sound/soc/atmel/mikroe-proto.c b/sound/soc/atmel/mikroe-proto.c
index ce46d8a0b7e4..954460719aa3 100644
--- a/sound/soc/atmel/mikroe-proto.c
+++ b/sound/soc/atmel/mikroe-proto.c
@@ -157,7 +157,9 @@ static int snd_proto_probe(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[] = {
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c
index 83b4a22bf15a..e4c805acc349 100644
--- a/sound/soc/fsl/pcm030-audio-fabric.c
+++ b/sound/soc/fsl/pcm030-audio-fabric.c
@@ -113,12 +113,11 @@ static int pcm030_fabric_probe(struct platform_device *op)
static int pcm030_fabric_remove(struct platform_device *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);
- return ret;
+ return 0;
}
static const struct of_device_id pcm030_audio_match[] = {
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9574f86dd4de..c5836066ead3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2326,14 +2326,12 @@ EXPORT_SYMBOL_GPL(snd_soc_register_card);
* @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);
snd_soc_unbind_card(card, true);
mutex_unlock(&client_mutex);
dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n", card->name);
-
- return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_unregister_card);
diff --git a/sound/soc/soc-topology-test.c b/sound/soc/soc-topology-test.c
index ae3968161509..225d74355974 100644
--- a/sound/soc/soc-topology-test.c
+++ b/sound/soc/soc-topology-test.c
@@ -271,9 +271,7 @@ static void snd_soc_tplg_test_load_with_null_comp(struct kunit *test)
KUNIT_EXPECT_EQ(test, 0, ret);
/* cleanup */
- ret = snd_soc_unregister_card(&kunit_comp->card);
- KUNIT_EXPECT_EQ(test, 0, ret);
-
+ snd_soc_unregister_card(&kunit_comp->card);
snd_soc_unregister_component(test_dev);
}
base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
--
2.36.1
More information about the Alsa-devel
mailing list