[U-Boot] [PATCH] fdt: fix dev_get_addr_name node offset

Stephen Warren swarren at wwwdotorg.org
Fri Apr 29 00:04:15 CEST 2016


From: Stephen Warren <swarren at nvidia.com>

Use the device's own DT offset, not the device's parent's.

Fixes: 43c4d44e3330 ("fdt: implement dev_get_addr_name()")
Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 drivers/core/device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index e7d4fa5d3f19..c6198da17b10 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -679,8 +679,8 @@ fdt_addr_t dev_get_addr_name(struct udevice *dev, const char *name)
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 	int index;
 
-	index = fdt_find_string(gd->fdt_blob, dev->parent->of_offset,
-				"reg-names", name);
+	index = fdt_find_string(gd->fdt_blob, dev->of_offset, "reg-names",
+				name);
 	if (index < 0)
 		return index;
 
-- 
2.8.1



More information about the U-Boot mailing list