]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/freescale/mpc8641hpcn/mpc8641hpcn.c
fdt: Try to use fdt_address_cells()/fdt_size_cells()
[karo-tx-uboot.git] / board / freescale / mpc8641hpcn / mpc8641hpcn.c
index 1ab72f94e62a16a0ab587273256c660878eb367d..94633b5c99dcc38334c939e24524d14ea1b4ed14 100644 (file)
@@ -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;