[alsa-devel] [PATCH] ASoC: simple-card: Do not set cpu_dai.name for snd_link in case DT
Using cpu_dai.name for DT case will result driver cannot be initialized. For example, device have name "ssi@10010000" in the DT and this value is returning for us by snd_soc_of_get_dai_name() but actual registered name of device is "10010000.ssi".
Signed-off-by: Alexander Shiyan shc_work@mail.ru --- sound/soc/generic/simple-card.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 1d87db8..3a054c4 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -219,7 +219,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev) */ cinfo->snd_link.name = cinfo->name; cinfo->snd_link.stream_name = cinfo->name; - cinfo->snd_link.cpu_dai_name = cinfo->cpu_dai.name; + if (!of_cpu) + cinfo->snd_link.cpu_dai_name = cinfo->cpu_dai.name; cinfo->snd_link.platform_name = cinfo->platform; cinfo->snd_link.codec_name = cinfo->codec; cinfo->snd_link.codec_dai_name = cinfo->codec_dai.name;
On Sun, Jan 05, 2014 at 10:09:58AM +0400, Alexander Shiyan wrote:
Using cpu_dai.name for DT case will result driver cannot be initialized. For example, device have name "ssi@10010000" in the DT and this value is returning for us by snd_soc_of_get_dai_name() but actual registered name of device is "10010000.ssi".
This doesn't seem like a great fix, it will break systems that register more than one DAI per device and won't help any other machine drivers using the lookup. I'd have expected to fix either the registered name or the result of the lookup so that it can be used for matching.
participants (2)
-
Alexander Shiyan
-
Mark Brown