diff options
author | Julian Scheel <julian@jusst.de> | 2017-05-24 13:28:23 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-05-24 19:43:21 +0300 |
commit | 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b (patch) | |
tree | 38335480c45375cc6a2eaf12ae464e78824f10fb /sound/soc/generic | |
parent | 2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff) | |
download | linux-7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b.tar.xz |
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: Julian Scheel <julian@jusst.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-card.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 2c9dedab5184..565d057f0d14 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -233,13 +233,19 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, snprintf(prop, sizeof(prop), "%scpu", prefix); 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); plat = of_get_child_by_name(node, prop); snprintf(prop, sizeof(prop), "%scodec", prefix); codec = of_get_child_by_name(node, prop); - if (!cpu || !codec) { + if (!codec) { ret = -EINVAL; dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop); goto dai_link_of_err; |