diff options
author | Simon Glass <sjg@chromium.org> | 2014-10-23 18:58:57 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-11-21 04:43:18 +0100 |
commit | 933cdbb479aa87dcb6e3e333c3d1e04b0e7de1ec (patch) | |
tree | 69cd2d313126c7114b56ec9497e0b3dcef8f04a0 /board/freescale/mpc8641hpcn/mpc8641hpcn.c | |
parent | 2640387148ad5e0197a8ac80c24f3473dee42a65 (diff) | |
download | u-boot-imx-933cdbb479aa87dcb6e3e333c3d1e04b0e7de1ec.zip u-boot-imx-933cdbb479aa87dcb6e3e333c3d1e04b0e7de1ec.tar.gz u-boot-imx-933cdbb479aa87dcb6e3e333c3d1e04b0e7de1ec.tar.bz2 |
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 <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'board/freescale/mpc8641hpcn/mpc8641hpcn.c')
-rw-r--r-- | board/freescale/mpc8641hpcn/mpc8641hpcn.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 1ab72f9..94633b5 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; |