From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/3] state: pass error code instead of inventing new one
Date: Thu, 20 Oct 2016 09:31:20 +0200 [thread overview]
Message-ID: <20161020073122.19295-1-s.hauer@pengutronix.de> (raw)
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>
---
common/state/state.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/common/state/state.c b/common/state/state.c
index 075618e..2be3c8c 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;
}
}
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2016-10-20 7:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 7:31 Sascha Hauer [this message]
2016-10-20 7:31 ` [PATCH 2/3] state: driver: handle EPROBE_DEFER Sascha Hauer
2016-10-20 7:31 ` [PATCH 3/3] of_path: handle no driver for device Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161020073122.19295-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox