diff mbox

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

Message ID 5e48940f440428b052bc7a856ab7d0a8b2fdf442.1478600213.git-series.maxime.ripard@free-electrons.com
State Deferred
Delegated to: Tom Rini
Headers show

Commit Message

Maxime Ripard Nov. 8, 2016, 10:19 a.m. UTC
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@free-electrons.com>
---
 lib/fdtdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

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);