mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
ASoC: fixup snd_soc_lookup_component_nolocked()
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: Because snd_dmaengine_pcm is sharing same dev with CPU and Platform, snd_soc_lookup_component_nolocked() might be call with NULL driver name (= CPU). This patch fixup and cleanup it.
This commit is contained in:
commit
ebba78e34d
|
|
@ -369,20 +369,25 @@ struct snd_soc_component
|
|||
*snd_soc_lookup_component_nolocked(struct device *dev, const char *driver_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
struct snd_soc_component *found_component;
|
||||
|
||||
found_component = NULL;
|
||||
for_each_component(component) {
|
||||
if ((dev == component->dev) &&
|
||||
(!driver_name ||
|
||||
(driver_name == component->driver->name) ||
|
||||
(strcmp(component->driver->name, driver_name) == 0))) {
|
||||
found_component = component;
|
||||
break;
|
||||
}
|
||||
if (dev != component->dev)
|
||||
continue;
|
||||
|
||||
if (!driver_name)
|
||||
return component;
|
||||
|
||||
if (!component->driver->name)
|
||||
continue;
|
||||
|
||||
if (component->driver->name == driver_name)
|
||||
return component;
|
||||
|
||||
if (strcmp(component->driver->name, driver_name) == 0)
|
||||
return component;
|
||||
}
|
||||
|
||||
return found_component;
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_lookup_component_nolocked);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user