Commit ac6a4dd3 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: use snd_soc_lookup_component() at snd_soc_unregister_component()

snd_soc_unregister_component() is now finding component manually,
but we already have snd_soc_lookup_component() to find component;
Let's use existing function.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87zhha252c.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b18768f5
...@@ -2876,29 +2876,19 @@ EXPORT_SYMBOL_GPL(snd_soc_register_component); ...@@ -2876,29 +2876,19 @@ EXPORT_SYMBOL_GPL(snd_soc_register_component);
* *
* @dev: The device to unregister * @dev: The device to unregister
*/ */
static int __snd_soc_unregister_component(struct device *dev) void snd_soc_unregister_component(struct device *dev)
{ {
struct snd_soc_component *component; struct snd_soc_component *component;
int found = 0;
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
for_each_component(component) { while (1) {
if (dev != component->dev) component = snd_soc_lookup_component(dev, NULL);
continue; if (!component)
break;
snd_soc_del_component_unlocked(component); snd_soc_del_component_unlocked(component);
found = 1;
break;
} }
mutex_unlock(&client_mutex); mutex_unlock(&client_mutex);
return found;
}
void snd_soc_unregister_component(struct device *dev)
{
while (__snd_soc_unregister_component(dev))
;
} }
EXPORT_SYMBOL_GPL(snd_soc_unregister_component); EXPORT_SYMBOL_GPL(snd_soc_unregister_component);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment