[PATCH] 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: Uwe Kleine-König u.kleine-koenig@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
Hi "Uwe,
I love your patch! Yet something to improve:
[auto build test ERROR on f2906aa863381afb0015a9eb7fefad885d4e5a56]
url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig/ASoC-core-Ma... base: f2906aa863381afb0015a9eb7fefad885d4e5a56 config: xtensa-randconfig-r003-20220620 (https://download.01.org/0day-ci/archive/20220622/202206221950.PW6xhJO1-lkp@i...) compiler: xtensa-linux-gcc (GCC) 11.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/5a135ba83d6b991aae0eed01f26464... git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Uwe-Kleine-K-nig/ASoC-core-Make-snd_soc_unregister_card-return-void/20220621-230233 git checkout 5a135ba83d6b991aae0eed01f26464524116abec # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=xtensa SHELL=/bin/bash sound/soc/
If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot lkp@intel.com
All errors (new ones prefixed by >>):
sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_with_null_ops':
sound/soc/soc-topology-test.c:316:13: error: void value not ignored as it ought to be
316 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_with_null_fw': sound/soc/soc-topology-test.c:380:13: error: void value not ignored as it ought to be 380 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_empty_tplg': sound/soc/soc-topology-test.c:429:13: error: void value not ignored as it ought to be 429 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_empty_tplg_bad_magic': sound/soc/soc-topology-test.c:485:13: error: void value not ignored as it ought to be 485 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_empty_tplg_bad_abi': sound/soc/soc-topology-test.c:541:13: error: void value not ignored as it ought to be 541 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_empty_tplg_bad_size': sound/soc/soc-topology-test.c:597:13: error: void value not ignored as it ought to be 597 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_empty_tplg_bad_payload_size': sound/soc/soc-topology-test.c:656:13: error: void value not ignored as it ought to be 656 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_pcm_tplg': sound/soc/soc-topology-test.c:705:13: error: void value not ignored as it ought to be 705 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_pcm_tplg_reload_comp': sound/soc/soc-topology-test.c:758:13: error: void value not ignored as it ought to be 758 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^ sound/soc/soc-topology-test.c: In function 'snd_soc_tplg_test_load_pcm_tplg_reload_card': sound/soc/soc-topology-test.c:807:21: error: void value not ignored as it ought to be 807 | ret = snd_soc_unregister_card(&kunit_comp->card); | ^
vim +316 sound/soc/soc-topology-test.c
d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 280 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 281 /* d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 282 * NULL ops is default case, we pass empty topology (fw), so we don't have d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 283 * anything to parse and just do nothing, which results in return 0; from d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 284 * calling soc_tplg_dapm_complete in soc_tplg_process_headers d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 285 */ d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 286 static void snd_soc_tplg_test_load_with_null_ops(struct kunit *test) d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 287 { d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 288 struct kunit_soc_component *kunit_comp; d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 289 int ret; d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 290 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 291 /* prepare */ d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 292 kunit_comp = kunit_kzalloc(test, sizeof(*kunit_comp), GFP_KERNEL); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 293 KUNIT_EXPECT_NOT_ERR_OR_NULL(test, kunit_comp); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 294 kunit_comp->kunit = test; d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 295 kunit_comp->expect = 0; /* expect success */ d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 296 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 297 kunit_comp->card.dev = test_dev, d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 298 kunit_comp->card.name = "kunit-card", d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 299 kunit_comp->card.owner = THIS_MODULE, d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 300 kunit_comp->card.dai_link = kunit_dai_links, d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 301 kunit_comp->card.num_links = ARRAY_SIZE(kunit_dai_links), d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 302 kunit_comp->card.fully_routed = true, d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 303 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 304 /* run test */ d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 305 ret = snd_soc_register_card(&kunit_comp->card); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 306 if (ret != 0 && ret != -EPROBE_DEFER) d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 307 KUNIT_FAIL(test, "Failed to register card"); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 308 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 309 ret = snd_soc_component_initialize(&kunit_comp->comp, &test_component, test_dev); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 310 KUNIT_EXPECT_EQ(test, 0, ret); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 311 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 312 ret = snd_soc_add_component(&kunit_comp->comp, NULL, 0); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 313 KUNIT_EXPECT_EQ(test, 0, ret); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 314 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 315 /* cleanup */ d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 @316 ret = snd_soc_unregister_card(&kunit_comp->card); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 317 KUNIT_EXPECT_EQ(test, 0, ret); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 318 d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 319 snd_soc_unregister_component(test_dev); d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 320 } d52bbf747cfa8a2 Amadeusz Sławiński 2021-01-20 321
On Tue, 21 Jun 2022 16:58:34 +0200, Uwe Kleine-König wrote:
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.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: core: Make snd_soc_unregister_card() return void commit: 1892a991886ace2c3450bec801df2cf4028a803a
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
On Wed, Jun 22, 2022 at 06:30:02PM +0100, Mark Brown wrote:
On Tue, 21 Jun 2022 16:58:34 +0200, Uwe Kleine-König wrote:
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.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Did you see the kernel bot report with the build issue? It doesn't make allmodconfig fail for me (that's why I didn't notice the issue). I'm looking into it.
Best regards Uwe
On Wed, Jun 22, 2022 at 10:50:46PM +0200, Uwe Kleine-König wrote:
Did you see the kernel bot report with the build issue? It doesn't make allmodconfig fail for me (that's why I didn't notice the issue). I'm looking into it.
Yes, it raced with me queuing it to apply I think. It doesn't trigger in an allmodconfig for me either.
participants (3)
-
kernel test robot
-
Mark Brown
-
Uwe Kleine-König