Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread jeffy
Hi guys, On 08/22/2017 10:26 PM, Takashi Iwai wrote: On Tue, 22 Aug 2017 16:21:11 +0200, Mark Brown wrote: On Tue, Aug 22, 2017 at 10:15:32PM +0800, Donglin Peng wrote: On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: We should be already verifying that drivers

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread jeffy
Hi guys, On 08/22/2017 10:26 PM, Takashi Iwai wrote: On Tue, 22 Aug 2017 16:21:11 +0200, Mark Brown wrote: On Tue, Aug 22, 2017 at 10:15:32PM +0800, Donglin Peng wrote: On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: We should be already verifying that drivers have a name, we assume

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Mark Brown
On Tue, Aug 22, 2017 at 04:26:59PM +0200, Takashi Iwai wrote: > Mark Brown wrote: > > We should fix that then. > Hmm, as far as I read the code, the NULL dai driver name is valid for > a single component. The dai name is determined by fmt_single_name(). We'll end up using it in debug stuff at

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Mark Brown
On Tue, Aug 22, 2017 at 04:26:59PM +0200, Takashi Iwai wrote: > Mark Brown wrote: > > We should fix that then. > Hmm, as far as I read the code, the NULL dai driver name is valid for > a single component. The dai name is determined by fmt_single_name(). We'll end up using it in debug stuff at

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Takashi Iwai
On Tue, 22 Aug 2017 16:21:11 +0200, Mark Brown wrote: > > On Tue, Aug 22, 2017 at 10:15:32PM +0800, Donglin Peng wrote: > > On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: > > > > We should be already verifying that drivers have a name, we assume one > > > elsewhere. >

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Takashi Iwai
On Tue, 22 Aug 2017 16:21:11 +0200, Mark Brown wrote: > > On Tue, Aug 22, 2017 at 10:15:32PM +0800, Donglin Peng wrote: > > On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: > > > > We should be already verifying that drivers have a name, we assume one > > > elsewhere. > > > But I can't find

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Mark Brown
On Tue, Aug 22, 2017 at 10:15:32PM +0800, Donglin Peng wrote: > On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: > > We should be already verifying that drivers have a name, we assume one > > elsewhere. > But I can't find any codes that set or check dai_driver->name in >

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Mark Brown
On Tue, Aug 22, 2017 at 10:15:32PM +0800, Donglin Peng wrote: > On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: > > We should be already verifying that drivers have a name, we assume one > > elsewhere. > But I can't find any codes that set or check dai_driver->name in > function

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Donglin Peng
On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: > On Tue, Aug 22, 2017 at 09:24:32PM +0800, Donglin Peng wrote: > >> In case that dai->driver->name is NULL, strcmp(dai->driver->name, >> dlc->dai_name) will cause segmentation fault. >> so I think that we can change it as

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Donglin Peng
On Tue, Aug 22, 2017 at 10:02 PM, Mark Brown wrote: > On Tue, Aug 22, 2017 at 09:24:32PM +0800, Donglin Peng wrote: > >> In case that dai->driver->name is NULL, strcmp(dai->driver->name, >> dlc->dai_name) will cause segmentation fault. >> so I think that we can change it as the follows: > > We

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Mark Brown
On Tue, Aug 22, 2017 at 09:24:32PM +0800, Donglin Peng wrote: > In case that dai->driver->name is NULL, strcmp(dai->driver->name, > dlc->dai_name) will cause segmentation fault. > so I think that we can change it as the follows: We should be already verifying that drivers have a name, we assume

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Mark Brown
On Tue, Aug 22, 2017 at 09:24:32PM +0800, Donglin Peng wrote: > In case that dai->driver->name is NULL, strcmp(dai->driver->name, > dlc->dai_name) will cause segmentation fault. > so I think that we can change it as the follows: We should be already verifying that drivers have a name, we assume

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Donglin Peng
Hi jeffy, On Tue, Aug 22, 2017 at 3:57 PM, Jeffy Chen wrote: > @@ -978,7 +978,8 @@ struct snd_soc_dai *snd_soc_find_dai( > if (dlc->name && strcmp(component->name, dlc->name)) > continue; >

Re: [PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Donglin Peng
Hi jeffy, On Tue, Aug 22, 2017 at 3:57 PM, Jeffy Chen wrote: > @@ -978,7 +978,8 @@ struct snd_soc_dai *snd_soc_find_dai( > if (dlc->name && strcmp(component->name, dlc->name)) > continue; > list_for_each_entry(dai, >dai_list, list) { > -

[PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Jeffy Chen
Currently we are searching dai name in snd_soc_find_dai, which could either be dai driver name or component device name(for legacy naming). Allow searching dai driver name in snd_soc_find_dai too, so that we can use dai driver name to find legacy naming dais. Signed-off-by: Jeffy Chen

[PATCH v5 2/9] ASoC: soc-core: Allow searching dai driver name in snd_soc_find_dai

2017-08-22 Thread Jeffy Chen
Currently we are searching dai name in snd_soc_find_dai, which could either be dai driver name or component device name(for legacy naming). Allow searching dai driver name in snd_soc_find_dai too, so that we can use dai driver name to find legacy naming dais. Signed-off-by: Jeffy Chen ---