diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bb0592159414..0ce333669138 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2876,29 +2876,19 @@ EXPORT_SYMBOL_GPL(snd_soc_register_component); * * @dev: The device to unregister */ -static int __snd_soc_unregister_component(struct device *dev) -{ - struct snd_soc_component *component; - int found = 0; - - mutex_lock(&client_mutex); - for_each_component(component) { - if (dev != component->dev) - continue; - - snd_soc_del_component_unlocked(component); - found = 1; - break; - } - mutex_unlock(&client_mutex); - - return found; -} - void snd_soc_unregister_component(struct device *dev) { - while (__snd_soc_unregister_component(dev)) - ; + struct snd_soc_component *component; + + mutex_lock(&client_mutex); + while (1) { + component = snd_soc_lookup_component(dev, NULL); + if (!component) + break; + + snd_soc_del_component_unlocked(component); + } + mutex_unlock(&client_mutex); } EXPORT_SYMBOL_GPL(snd_soc_unregister_component);