From 58f4bb833b22da464b94e3d0088338eb4e5f4dcc Mon Sep 17 00:00:00 2001 From: Johan Jonker Date: Wed, 10 May 2023 23:48:44 +0200 Subject: [PATCH] core: fdtaddr: use map_sysmem() as cast for the return (part 2) For the devfdt_get_addr_size_index_ptr() function use map_sysmem() function as cast for the return for use in sandbox. Signed-off-by: Johan Jonker --- drivers/core/fdtaddr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c index 3b59b70c24..546db675aa 100644 --- a/drivers/core/fdtaddr.c +++ b/drivers/core/fdtaddr.c @@ -131,7 +131,10 @@ void *devfdt_get_addr_size_index_ptr(const struct udevice *dev, int index, { fdt_addr_t addr = devfdt_get_addr_size_index(dev, index, size); - return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)(uintptr_t)addr; + if (addr == FDT_ADDR_T_NONE) + return NULL; + + return map_sysmem(addr, 0); } fdt_addr_t devfdt_get_addr_name(const struct udevice *dev, const char *name) -- 2.39.5