]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
Merge branch 'master' of git://git.denx.de/u-boot-spi
[u-boot] / board / freescale / p1_p2_rdb_pc / p1_p2_rdb_pc.c
index a6756c68f40f3698a330249299a13b3bb9317a95..61b7a91333faf1beb07f981822c8fd76325bf6a2 100644 (file)
@@ -424,12 +424,17 @@ static void fdt_board_fixup_qe_pins(void *blob)
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
+#if defined(CONFIG_P1020RDB_PD) || defined(CONFIG_P1020RDB_PC)
        const char *soc_usb_compat = "fsl-usb2-dr";
-       int err, usb1_off, usb2_off;
+       int usb_err, usb1_off, usb2_off;
+#endif
+#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
+       int err;
+#endif
 
        ft_cpu_setup(blob, bd);
 
@@ -459,42 +464,43 @@ void ft_board_setup(void *blob, bd_t *bd)
                int off = fdt_node_offset_by_compatible(blob, -1,
                                soc_elbc_compat);
                if (off < 0) {
-                       printf("WARNING: could not find compatible node %s: %s.\n",
-                              soc_elbc_compat,
-                              fdt_strerror(off));
-                               return;
+                       printf("WARNING: could not find compatible node %s\n",
+                              soc_elbc_compat);
+                       return off;
                }
                err = fdt_del_node(blob, off);
                if (err < 0) {
-                       printf("WARNING: could not remove %s: %s.\n",
-                              soc_elbc_compat, fdt_strerror(err));
+                       printf("WARNING: could not remove %s\n",
+                              soc_elbc_compat);
+                       return err;
                }
-               return;
+               return 0;
        }
 #endif
 
+#if defined(CONFIG_P1020RDB_PD) || defined(CONFIG_P1020RDB_PC)
 /* Delete USB2 node as it is muxed with eLBC */
        usb1_off = fdt_node_offset_by_compatible(blob, -1,
                soc_usb_compat);
        if (usb1_off < 0) {
-               printf("WARNING: could not find compatible node %s: %s.\n",
-                      soc_usb_compat,
-                      fdt_strerror(usb1_off));
-               return;
+               printf("WARNING: could not find compatible node %s\n",
+                      soc_usb_compat);
+               return usb1_off;
        }
        usb2_off = fdt_node_offset_by_compatible(blob, usb1_off,
                        soc_usb_compat);
        if (usb2_off < 0) {
-               printf("WARNING: could not find compatible node %s: %s.\n",
-                      soc_usb_compat,
-                      fdt_strerror(usb2_off));
-               return;
+               printf("WARNING: could not find compatible node %s\n",
+                      soc_usb_compat);
+               return usb2_off;
        }
-       err = fdt_del_node(blob, usb2_off);
-       if (err < 0) {
-               printf("WARNING: could not remove %s: %s.\n",
-                      soc_usb_compat, fdt_strerror(err));
+       usb_err = fdt_del_node(blob, usb2_off);
+       if (usb_err < 0) {
+               printf("WARNING: could not remove %s\n", soc_usb_compat);
+               return usb_err;
        }
+#endif
 
+       return 0;
 }
 #endif