[alsa-devel] [PATCH] ASoC: soc-core: call soc_cleanup_card_debugfs() from snd_soc_unregister_card()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Mar 24 09:17:13 CET 2015


Hi Takashi

Thank you for your feedback

> If the reason is different (e.g. for further fix of hot unplug bug),
> it'd be understandable, though.  In general, the ALSA device free
> consists of three phases:
> 1. device disconnection
> 2. wait until all devices are closed
> 3. actual free all resources
> 
> And soc_cleanup_card_debugfs() basically belongs to 1, not 3.

Hmm... I'm not 100% understand detail of ASoC functions,
but if so, debugfs should be created when "device connect", but
current code is creating it in "device register".
Can I assume that snd_soc_instantiate_card() <-> soc_cleanup_card_resources() are
paired function ? I'm not sure...
Anyway, it is easy to understand for me if
paired functions are called from paired parent functions if possible.
Currently debugfs is like this.

snd_soc_register_card()       <-> snd_soc_unregister_card()
 - soc_init_card_debugfs()           ????
 - snd_soc_instantiate_card() <->  - soc_cleanup_card_resources()
   - soc_bind_dai_link()             - soc_remove_dai_links()
   - soc_probe_aux_dev()             - soc_remove_aux_dev()
   - card->probe()                   - card->remove()
   - ????                            - soc_cleanup_card_debugfs()


More information about the Alsa-devel mailing list