Skip to content

Commit 2ed2216

Browse files
Andrei Simionbroonie
authored andcommitted
ASoC: atmel: atmel-classd: Re-add dai_link->platform to fix card init
The removed dai_link->platform component cause a fail which is exposed at runtime. (ex: when a sound tool is used) This patch re-adds the dai_link->platform component to have a full card registered. Before this patch: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 :~$ speaker-test -t sine speaker-test 1.2.6 Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Sine wave rate is 440.0000Hz Playback open error: -22,Invalid argument After this patch which restores the platform component: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [CLASSD PCM snd-soc-dummy-dai-0] Subdevices: 1/1 Subdevice #0: subdevice #0 -> Resolve the playback error. Fixes: 2f650f8 ("ASoC: atmel: remove unnecessary dai_link->platform") Signed-off-by: Andrei Simion <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 97d8613 commit 2ed2216

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/atmel/atmel-classd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,22 @@ static int atmel_classd_asoc_card_init(struct device *dev,
473473
if (!dai_link)
474474
return -ENOMEM;
475475

476-
comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
476+
comp = devm_kzalloc(dev, 2 * sizeof(*comp), GFP_KERNEL);
477477
if (!comp)
478478
return -ENOMEM;
479479

480-
dai_link->cpus = comp;
480+
dai_link->cpus = &comp[0];
481481
dai_link->codecs = &snd_soc_dummy_dlc;
482+
dai_link->platforms = &comp[1];
482483

483484
dai_link->num_cpus = 1;
484485
dai_link->num_codecs = 1;
486+
dai_link->num_platforms = 1;
485487

486488
dai_link->name = "CLASSD";
487489
dai_link->stream_name = "CLASSD PCM";
488490
dai_link->cpus->dai_name = dev_name(dev);
491+
dai_link->platforms->name = dev_name(dev);
489492

490493
card->dai_link = dai_link;
491494
card->num_links = 1;

0 commit comments

Comments
 (0)