summaryrefslogtreecommitdiffstats
path: root/common/state
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-10-20 09:25:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-10-20 09:31:07 +0200
commit8099956f6a99fbedc9a81ef5e3f480b9bc4e9424 (patch)
tree037377ac0216292b35a9a5198211d12d938ded0d /common/state
parent75ee6ab0765d67f84d8152d3d18065c17ea9b50c (diff)
downloadbarebox-8099956f6a99fbedc9a81ef5e3f480b9bc4e9424.tar.gz
barebox-8099956f6a99fbedc9a81ef5e3f480b9bc4e9424.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>
Diffstat (limited to 'common/state')
-rw-r--r--common/state/state.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/state/state.c b/common/state/state.c
index 075618e5bb..2be3c8c5c5 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -466,9 +466,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) {
- pr_err("state failed to parse path to backend\n");
- ret = -EINVAL;
+ if (ret) {
+ if (ret != -EPROBE_DEFER)
+ pr_err("state failed to parse path to backend: %s\n",
+ strerror(-ret));
goto out_release_state;
}
}