[U-Boot] [PATCH v2] dm: core: Add dev_get_addr_ptr() to return a pointer to the reg address
Bin Meng
bmeng.cn at gmail.com
Thu Apr 21 10:11:54 CEST 2016
On Thu, Apr 21, 2016 at 1:11 PM, Stefan Roese <sr at denx.de> wrote:
> On some platforms (e.g. x86), the return value of dev_get_addr() can't
> be assigned to a pointer type variable directly. As there might be a
> difference between the size of fdt_addr_t and the pointer type. On
> x86 for example, "fdt_addr_t" is 64bit but "void *" only 32bit. So
> assigning the register base directly in dev_get_addr() results in this
> compilation warning:
> warning: cast to pointer from integer of different size
>
> This patch introduces the new function dev_get_addr_ptr() that
> returns a pointer to the 'reg' address that can be used by drivers
> in this case.
>
> Signed-off-by: Stefan Roese <sr at denx.de>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> ---
> v2:
> - Mention error condition in function prototype as suggested by Simon
>
> drivers/core/device.c | 5 +++++
> include/dm/device.h | 10 ++++++++++
> 2 files changed, 15 insertions(+)
>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
More information about the U-Boot
mailing list