]> git.ipfire.org Git - people/ms/u-boot.git/commit
dm: core: Correct address cast in dev_read_addr_ptr()
authorSimon Glass <sjg@chromium.org>
Thu, 28 Sep 2017 12:35:15 +0000 (06:35 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 17 Nov 2017 01:45:05 +0000 (18:45 -0700)
commit8ccc2db6e84244e5cb57885dc9dfd7e752071b98
treedf1320df9fd4d15b5bf088e5f1c74dfb3af0cd7b
parent6dfd65f81fd060a85c961a84f85a286e8e96332c
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>
drivers/core/read.c