Skip to content

Commit b0275d9

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-card: add snd_soc_card_remove()
Card related function should be implemented at soc-card now. This patch adds it. Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5c0eac0 commit b0275d9

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

include/sound/soc-card.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ int snd_soc_card_resume_post(struct snd_soc_card *card);
2626

2727
int snd_soc_card_probe(struct snd_soc_card *card);
2828
int snd_soc_card_late_probe(struct snd_soc_card *card);
29+
int snd_soc_card_remove(struct snd_soc_card *card);
2930

3031
/* device driver data */
3132
static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,

sound/soc/soc-card.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,16 @@ int snd_soc_card_late_probe(struct snd_soc_card *card)
166166

167167
return 0;
168168
}
169+
170+
int snd_soc_card_remove(struct snd_soc_card *card)
171+
{
172+
int ret = 0;
173+
174+
if (card->probed &&
175+
card->remove)
176+
ret = card->remove(card);
177+
178+
card->probed = 0;
179+
180+
return soc_card_ret(card, ret);
181+
}

sound/soc/soc-core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,9 +1747,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
17471747
soc_cleanup_card_debugfs(card);
17481748

17491749
/* remove the card */
1750-
if (card->probed && card->remove)
1751-
card->remove(card);
1752-
card->probed = 0;
1750+
snd_soc_card_remove(card);
17531751

17541752
if (card->snd_card) {
17551753
snd_card_free(card->snd_card);

0 commit comments

Comments
 (0)