[alsa-devel] [PATCH 5/9] ASoC: soc-core: use soc_find_component() at snd_soc_get_dai_id()

Jon Hunter jonathanh at nvidia.com
Wed Jun 26 00:38:14 CEST 2019


On 25/06/2019 21:47, Dmitry Osipenko wrote:
> 13.05.2019 10:07, Kuninori Morimoto пишет:
>> From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
>>
>> soc-core core already has soc_find_component() which find
>> component from device node.
>> Let's use existing function to find component.
>>
>> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
>> ---
>>  sound/soc/soc-core.c | 17 +++++------------
>>  1 file changed, 5 insertions(+), 12 deletions(-)
>>
>> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
>> index e55170c..e83edbe 100644
>> --- a/sound/soc/soc-core.c
>> +++ b/sound/soc/soc-core.c
>> @@ -3751,7 +3751,7 @@ EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
>>  
>>  int snd_soc_get_dai_id(struct device_node *ep)
>>  {
>> -	struct snd_soc_component *pos;
>> +	struct snd_soc_component *component;
>>  	struct device_node *node;
>>  	int ret;
>>  
>> @@ -3765,17 +3765,10 @@ int snd_soc_get_dai_id(struct device_node *ep)
>>  	 */
>>  	ret = -ENOTSUPP;
>>  	mutex_lock(&client_mutex);
>> -	for_each_component(pos) {
>> -		struct device_node *component_of_node = soc_component_to_node(pos);
>> -
>> -		if (component_of_node != node)
>> -			continue;
>> -
>> -		if (pos->driver->of_xlate_dai_id)
>> -			ret = pos->driver->of_xlate_dai_id(pos, ep);
>> -
>> -		break;
>> -	}
>> +	component = soc_find_component(node, NULL);
>> +	if (component &&
>> +	    component->driver->of_xlate_dai_id)
>> +		ret = component->driver->of_xlate_dai_id(component, ep);
>>  	mutex_unlock(&client_mutex);
>>  
>>  	of_node_put(node);
>>
> 
> Hi,
> 
> This patch causes crash on today's linux-next apparently because "CPU DAI" is not
> registered now, any ideas?

FWIW I am seeing the same crash/regression, however, the bisect is
pointing to commit b9f2e25c599bbbf0646957e07ebb72b942c286cc ("ASoC:
soc-core: use soc_find_component() at snd_soc_find_dai()") and reverting
this commit fixes the problem for me.

Dmitry, are you sure it is this commit? They do have a similar name.

Cheers
Jon

-- 
nvpublic


More information about the Alsa-devel mailing list