diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-08-07 02:06:55 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-08-16 13:05:14 +0100 |
commit | 2eccea8cdeb8fe455fc3a45b4e097f118449c3ef (patch) | |
tree | 8eebd4aeb0e6ac9883be7d3d0a302aef81764079 /sound/soc/soc-core.c | |
parent | 9b56741710c18fe97254d6b0d1ca0ebd7bc699c4 (diff) | |
download | lwn-2eccea8cdeb8fe455fc3a45b4e097f118449c3ef.tar.gz lwn-2eccea8cdeb8fe455fc3a45b4e097f118449c3ef.zip |
ASoC: soc-core: snd_soc_unregister_component() unregister all component
Current snd_soc_unregister_component() unregisters first found
component only which was specified by dev.
This style can't specify concrete component if system registered some
component with same dev. And system need to call this function many
times.
This patch unregister all related component by 1 call.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b1860b14b075..50c8dba54649 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3365,11 +3365,12 @@ err_free: EXPORT_SYMBOL_GPL(snd_soc_register_component); /** - * snd_soc_unregister_component - Unregister a component from the ASoC core + * snd_soc_unregister_component - Unregister all related component + * from the ASoC core * * @dev: The device to unregister */ -void snd_soc_unregister_component(struct device *dev) +static int __snd_soc_unregister_component(struct device *dev) { struct snd_soc_component *component; int found = 0; @@ -3391,6 +3392,13 @@ void snd_soc_unregister_component(struct device *dev) snd_soc_component_cleanup(component); kfree(component); } + + return found; +} + +void snd_soc_unregister_component(struct device *dev) +{ + while (__snd_soc_unregister_component(dev)); } EXPORT_SYMBOL_GPL(snd_soc_unregister_component); |