mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
dm: core: Correct address cast in dev_read_addr_ptr()
This currently causes a warning in sandbox and will not do the right
thing:
drivers/core/read.c: In function ‘dev_read_addr_ptr’:
drivers/core/read.c:64:44: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
Use map_sysmem() which is the correct way to convert an address to a
pointer.
Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:
parent
6dfd65f81f
commit
8ccc2db6e8
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <mapmem.h>
|
||||
#include <dm/of_access.h>
|
||||
|
||||
int dev_read_u32_default(struct udevice *dev, const char *propname, int def)
|
||||
|
|
@ -61,7 +62,7 @@ void *dev_read_addr_ptr(struct udevice *dev)
|
|||
{
|
||||
fdt_addr_t addr = dev_read_addr(dev);
|
||||
|
||||
return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
|
||||
return (addr == FDT_ADDR_T_NONE) ? NULL : map_sysmem(addr, 0);
|
||||
}
|
||||
|
||||
fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *property,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue