summaryrefslogtreecommitdiff
path: root/include/sound/core.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-02-07 20:19:05 +0100
committerTakashi Iwai <tiwai@suse.de>2023-02-08 13:38:28 +0100
commit663f922fd7a9e9342dca512db339c7fb2b59b8e6 (patch)
tree11e8d187f7bf79dd31fc9004c70e6846607610af /include/sound/core.h
parent69218b59be20689cc62ee87cd2890c58c41bae15 (diff)
ALSA: core: Make snd_card_disconnect() return void
All callers from other files ignore the return value of this function. And it can only ever return a non-zero value if the parameter card is NULL. Move the check for card being NULL into snd_card_free_when_closed() to keep the previous behaviour. Note this isn't necessary for snd_card_disconnect_sync() because if card was NULL in there the dereference of card for dev_err() would oops the kernel. Replace this by an oops triggered by the dereference of card for spin_lock_irq(). 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-2-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r--include/sound/core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 4365c35d038b..9a73c60b6f1e 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -286,7 +286,7 @@ int snd_devm_card_new(struct device *parent, int idx, const char *xid,
struct module *module, size_t extra_size,
struct snd_card **card_ret);
-int snd_card_disconnect(struct snd_card *card);
+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);
int snd_card_free_when_closed(struct snd_card *card);