[U-Boot] [PATCH RESEND 1/9] fdtdec: Fix alias retrieval

Maxime Ripard maxime.ripard at free-electrons.com
Tue Nov 8 11:19:21 CET 2016


When the subsystem in u-boot ends up with a number, the alias parsing
mechanism was off, being confused between the actual number, and the alias
number.

Fix the code to start parsing the alias at the end of our subsystem name.

Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
---
 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 4e619c49a2ff..fc31e3576e5c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -538,7 +538,8 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset,
 		slash = strrchr(prop, '/');
 		if (strcmp(slash + 1, find_name))
 			continue;
-		val = trailing_strtol(name);
+
+		val = simple_strtol(name + base_len, NULL, 10);
 		if (val != -1) {
 			*seqp = val;
 			debug("Found seq %d\n", *seqp);
-- 
git-series 0.8.11


More information about the U-Boot mailing list