mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
ASoC: soc-core: move snd_soc_lookup_component()
This patch moves snd_soc_lookup_component() to upper side. This is prepare for snd_soc_unregister_component() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/875zjy3jnd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
bc7a9091e5
commit
b813265799
@ -356,6 +356,32 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_rtdcom_lookup);
|
||||
|
||||
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
|
||||
const char *driver_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
struct snd_soc_component *ret;
|
||||
|
||||
ret = NULL;
|
||||
mutex_lock(&client_mutex);
|
||||
for_each_component(component) {
|
||||
if (dev != component->dev)
|
||||
continue;
|
||||
|
||||
if (driver_name &&
|
||||
(driver_name != component->driver->name) &&
|
||||
(strcmp(component->driver->name, driver_name) != 0))
|
||||
continue;
|
||||
|
||||
ret = component;
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&client_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
|
||||
|
||||
struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card,
|
||||
const char *dai_link, int stream)
|
||||
{
|
||||
@ -2889,32 +2915,6 @@ void snd_soc_unregister_component(struct device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_unregister_component);
|
||||
|
||||
struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
|
||||
const char *driver_name)
|
||||
{
|
||||
struct snd_soc_component *component;
|
||||
struct snd_soc_component *ret;
|
||||
|
||||
ret = NULL;
|
||||
mutex_lock(&client_mutex);
|
||||
for_each_component(component) {
|
||||
if (dev != component->dev)
|
||||
continue;
|
||||
|
||||
if (driver_name &&
|
||||
(driver_name != component->driver->name) &&
|
||||
(strcmp(component->driver->name, driver_name) != 0))
|
||||
continue;
|
||||
|
||||
ret = component;
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&client_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
|
||||
|
||||
/* Retrieve a card's name from device tree */
|
||||
int snd_soc_of_parse_card_name(struct snd_soc_card *card,
|
||||
const char *propname)
|
||||
|
Loading…
Reference in New Issue
Block a user