Commit 869858f8 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Mark Brown

ASoC: simple-card: Dereference pointer for memcpy sizeof in asoc_simple_card_probe

Commit 4fb7f4df ("ASoC: simple-card: use cpu/codec pointer on
simple_dai_props") updated {cpu,codec}_dai to be pointers in struct
simple_dai_props but didn't update these locations to dereference the
pointers.
This patch fixup it for non DT simple-card use case.
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f0b3f841
...@@ -429,6 +429,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) ...@@ -429,6 +429,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
struct asoc_simple_card_info *cinfo; struct asoc_simple_card_info *cinfo;
struct snd_soc_dai_link_component *codecs; struct snd_soc_dai_link_component *codecs;
struct snd_soc_dai_link_component *platform; struct snd_soc_dai_link_component *platform;
int dai_idx = 0;
cinfo = dev->platform_data; cinfo = dev->platform_data;
if (!cinfo) { if (!cinfo) {
...@@ -445,6 +446,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev) ...@@ -445,6 +446,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
dai_props->cpu_dai = &priv->dais[dai_idx++];
dai_props->codec_dai = &priv->dais[dai_idx++];
codecs = dai_link->codecs; codecs = dai_link->codecs;
codecs->name = cinfo->codec; codecs->name = cinfo->codec;
codecs->dai_name = cinfo->codec_dai.name; codecs->dai_name = cinfo->codec_dai.name;
...@@ -458,10 +462,10 @@ static int asoc_simple_card_probe(struct platform_device *pdev) ...@@ -458,10 +462,10 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
dai_link->cpu_dai_name = cinfo->cpu_dai.name; dai_link->cpu_dai_name = cinfo->cpu_dai.name;
dai_link->dai_fmt = cinfo->daifmt; dai_link->dai_fmt = cinfo->daifmt;
dai_link->init = asoc_simple_card_dai_init; dai_link->init = asoc_simple_card_dai_init;
memcpy(&priv->dai_props->cpu_dai, &cinfo->cpu_dai, memcpy(priv->dai_props->cpu_dai, &cinfo->cpu_dai,
sizeof(priv->dai_props->cpu_dai)); sizeof(*priv->dai_props->cpu_dai));
memcpy(&priv->dai_props->codec_dai, &cinfo->codec_dai, memcpy(priv->dai_props->codec_dai, &cinfo->codec_dai,
sizeof(priv->dai_props->codec_dai)); sizeof(*priv->dai_props->codec_dai));
} }
snd_soc_card_set_drvdata(card, priv); snd_soc_card_set_drvdata(card, priv);
......
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