Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -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;