Skip to content

Commit 77b49b3

Browse files
committed
ASoC: soc-core: Add dynamic debug logs in soc_dai_link_sanity_check()
When a platform device is created successfully but the machine driver probe fails due to errors with missing components during the card bind stage, no error is propagated or logged. To help flag such problems, add a dynamic debug log. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent eaae268 commit 77b49b3

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

sound/soc/soc-core.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,12 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
865865
* Defer card registration if codec component is not added to
866866
* component list.
867867
*/
868-
if (!soc_find_component(codec))
868+
if (!soc_find_component(codec)) {
869+
dev_dbg(card->dev,
870+
"ASoC: codec component %s not found for link %s\n",
871+
codec->name, link->name);
869872
return -EPROBE_DEFER;
873+
}
870874
}
871875

872876
for_each_link_platforms(link, i, platform) {
@@ -886,8 +890,12 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
886890
* Defer card registration if platform component is not added to
887891
* component list.
888892
*/
889-
if (!soc_find_component(platform))
893+
if (!soc_find_component(platform)) {
894+
dev_dbg(card->dev,
895+
"ASoC: platform component %s not found for link %s\n",
896+
platform->name, link->name);
890897
return -EPROBE_DEFER;
898+
}
891899
}
892900

893901
for_each_link_cpus(link, i, cpu) {
@@ -908,8 +916,12 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
908916
* component list.
909917
*/
910918
if ((cpu->of_node || cpu->name) &&
911-
!soc_find_component(cpu))
919+
!soc_find_component(cpu)) {
920+
dev_dbg(card->dev,
921+
"ASoC: cpu component %s not found for link %s\n",
922+
cpu->name, link->name);
912923
return -EPROBE_DEFER;
924+
}
913925

914926
/*
915927
* At least one of CPU DAI name or CPU device name/node must be

0 commit comments

Comments
 (0)