Commit 971da24c authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: snd_soc_rtdcom_lookup() cares component driver name

snd_soc_rtdcom_lookup() look up component by uisng driver name.
Then, it uses component->driver->name.
Some driver might doesn't have it, thus it should care NULL pointer.
This patch solve this issue.
Reported-by: default avatarMukunda,Vijendar <vijendar.mukunda@amd.com>
Reported-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarMukunda,Vijendar <vijendar.mukunda@amd.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 031734b7
...@@ -590,9 +590,17 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd, ...@@ -590,9 +590,17 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd,
{ {
struct snd_soc_rtdcom_list *rtdcom; struct snd_soc_rtdcom_list *rtdcom;
if (!driver_name)
return NULL;
for_each_rtdcom(rtd, rtdcom) { for_each_rtdcom(rtd, rtdcom) {
if ((rtdcom->component->driver->name == driver_name) || const char *component_name = rtdcom->component->driver->name;
strcmp(rtdcom->component->driver->name, driver_name) == 0)
if (!component_name)
continue;
if ((component_name == driver_name) ||
strcmp(component_name, driver_name) == 0)
return rtdcom->component; return rtdcom->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