summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-10-20 09:25:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:16 +0200
commit1af4f599c2b2047dc09ebf2954583f7d85d09a6a (patch)
tree4e41473236c1cdcc134756cf0eadfc3a6f496159
parented99f90e6b2e30bea7e1cc55e8870054fb7410c1 (diff)
downloaddt-utils-1af4f599c2b2047dc09ebf2954583f7d85d09a6a.tar.gz
dt-utils-1af4f599c2b2047dc09ebf2954583f7d85d09a6a.tar.xz
state: pass error code instead of inventing new one
Both of_find_path() and of_find_path_by_node() return a meaningful error code, so forward it instead of inventing a new one. Do this especially for the -EPROBE_DEFER case which currently does not work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/state.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c
index a993088..ef36cb6 100644
--- a/src/barebox-state/state.c
+++ b/src/barebox-state/state.c
@@ -465,9 +465,10 @@ struct state *state_new_from_node(struct device_node *node, char *path,
of_path = partition_node->full_name;
ret = of_find_path_by_node(partition_node, &path, 0);
}
- if (!path) {
- dev_err(&state->dev, "state failed to parse path to backend\n");
- ret = -EINVAL;
+ if (ret) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(&state->dev, "state failed to parse path to backend: %s\n",
+ strerror(-ret));
goto out_release_state;
}
}