Commit 7ac45d16 authored by Julian Scheel's avatar Julian Scheel Committed by Mark Brown

ASoC: simple-card: Fix misleading error message

In case cpu could not be found the error message would always refer to
/codec/ not being found in DT. Fix this by catching the cpu node not found
case explicitly.
Signed-off-by: default avatarJulian Scheel <julian@jusst.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea659a9
...@@ -233,13 +233,19 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, ...@@ -233,13 +233,19 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
snprintf(prop, sizeof(prop), "%scpu", prefix); snprintf(prop, sizeof(prop), "%scpu", prefix);
cpu = of_get_child_by_name(node, prop); cpu = of_get_child_by_name(node, prop);
if (!cpu) {
ret = -EINVAL;
dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop);
goto dai_link_of_err;
}
snprintf(prop, sizeof(prop), "%splat", prefix); snprintf(prop, sizeof(prop), "%splat", prefix);
plat = of_get_child_by_name(node, prop); plat = of_get_child_by_name(node, prop);
snprintf(prop, sizeof(prop), "%scodec", prefix); snprintf(prop, sizeof(prop), "%scodec", prefix);
codec = of_get_child_by_name(node, prop); codec = of_get_child_by_name(node, prop);
if (!cpu || !codec) { if (!codec) {
ret = -EINVAL; ret = -EINVAL;
dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop); dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop);
goto dai_link_of_err; goto dai_link_of_err;
......
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