From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
ASoC devices are organized as [CPU]-[CARD]-[CODEC]. Then, [CPU]/[CODEC] are based on [component] structure. Now, each [CARD] device knows that it has organized from which [component]. But current [component] doesn't inform to [CARD] that it was removed when user called rmmod or unbind it. Thus, [CARD] which lost some [components] still exist in system. And then, ALSA sound card will have some problem if user used this [CARD] in such timing. This patch unregister [CARD] when [component] was removed. If you want to use this [CARD] again, you need to re-insmod or re-bind removed [component] and [CARD] again.
Reported-by: Nguyen Viet Dung nv-dung@jinso.co.jp Reported-by: Bui Duc Phuc bd-phuc@jinso.co.jp Reported-by: Cao Minh Hiep cm-hiep@jinso.co.jp Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/soc-core.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index ededb97..cd5db21 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2695,6 +2695,7 @@ static void snd_soc_component_add(struct snd_soc_component *component) static void snd_soc_component_cleanup(struct snd_soc_component *component) { snd_soc_unregister_dais(component); + snd_soc_unregister_card(component->card); kfree(component->name); }