From 933cdbb479aa87dcb6e3e333c3d1e04b0e7de1ec Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 23 Oct 2014 18:58:57 -0600 Subject: fdt: Try to use fdt_address_cells()/fdt_size_cells() Use these new functions where possible. They default to a value of 2 so we cannot use them in some places where we need a default value of 1. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 1ab72f94e6..94633b5c99 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -123,7 +123,7 @@ int ft_board_setup(void *blob, bd_t *bd) { int off; u64 *tmp; - u32 *addrcells; + int addrcells; ft_cpu_setup(blob, bd); @@ -135,12 +135,13 @@ int ft_board_setup(void *blob, bd_t *bd) * which is defined by the "reg" property in the soc node. */ off = fdt_path_offset(blob, "/soc8641"); - addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL); + addrcells = fdt_address_cells(blob, 0); tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL); if (tmp) { u64 addr; - if (addrcells && (*addrcells == 1)) + + if (addrcells == 1) addr = *(u32 *)tmp; else addr = *tmp; -- cgit v1.2.1