Skip to content

Commit a64067f

Browse files
robhancocksedbroonie
authored andcommitted
ASoC: simple-card: fix probe failure on platform component
A previous change to simple-card resulted in asoc_simple_parse_dai attempting to retrieve the dai_name for platform components, which are unlikely to have a valid DAI name. This caused simple-card to fail to probe when using the xlnx_formatter_pcm as the platform component, since it does not register any DAI components. Since the dai_name is not used for platform components, just skip trying to retrieve it for those. Fixes: f107294 ("ASoC: simple-card: support snd_soc_dai_link_component style for cpu") Signed-off-by: Robert Hancock <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e958b58 commit a64067f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

sound/soc/generic/simple-card.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@ static const struct snd_soc_ops simple_ops = {
2828
.hw_params = asoc_simple_hw_params,
2929
};
3030

31+
static int asoc_simple_parse_platform(struct device_node *node,
32+
struct snd_soc_dai_link_component *dlc)
33+
{
34+
struct of_phandle_args args;
35+
int ret;
36+
37+
if (!node)
38+
return 0;
39+
40+
/*
41+
* Get node via "sound-dai = <&phandle port>"
42+
* it will be used as xxx_of_node on soc_bind_dai_link()
43+
*/
44+
ret = of_parse_phandle_with_args(node, DAI, CELL, 0, &args);
45+
if (ret)
46+
return ret;
47+
48+
/* dai_name is not required and may not exist for plat component */
49+
50+
dlc->of_node = args.np;
51+
52+
return 0;
53+
}
54+
3155
static int asoc_simple_parse_dai(struct device_node *node,
3256
struct snd_soc_dai_link_component *dlc,
3357
int *is_single_link)
@@ -289,7 +313,7 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
289313
if (ret < 0)
290314
goto dai_link_of_err;
291315

292-
ret = asoc_simple_parse_dai(plat, platforms, NULL);
316+
ret = asoc_simple_parse_platform(plat, platforms);
293317
if (ret < 0)
294318
goto dai_link_of_err;
295319

0 commit comments

Comments
 (0)