Skip to content

Commit

Permalink
ASoC: soc-core: Add dynamic debug logs in soc_dai_link_sanity_check()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Guennadi Liakhovetski <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
Reviewed-by: Kai Vehmanen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
ranj063 authored and broonie committed Apr 14, 2020
1 parent 642646c commit b2acc24
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,12 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
* Defer card registration if codec component is not added to
* component list.
*/
if (!soc_find_component(codec))
if (!soc_find_component(codec)) {
dev_dbg(card->dev,
"ASoC: codec component %s not found for link %s\n",
codec->name, link->name);
return -EPROBE_DEFER;
}
}

for_each_link_platforms(link, i, platform) {
Expand All @@ -886,8 +890,12 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
* Defer card registration if platform component is not added to
* component list.
*/
if (!soc_find_component(platform))
if (!soc_find_component(platform)) {
dev_dbg(card->dev,
"ASoC: platform component %s not found for link %s\n",
platform->name, link->name);
return -EPROBE_DEFER;
}
}

for_each_link_cpus(link, i, cpu) {
Expand All @@ -908,8 +916,12 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
* component list.
*/
if ((cpu->of_node || cpu->name) &&
!soc_find_component(cpu))
!soc_find_component(cpu)) {
dev_dbg(card->dev,
"ASoC: cpu component %s not found for link %s\n",
cpu->name, link->name);
return -EPROBE_DEFER;
}

/*
* At least one of CPU DAI name or CPU device name/node must be
Expand Down

0 comments on commit b2acc24

Please sign in to comment.