]> git.sur5r.net Git - u-boot/commitdiff
fpga: Fix Spartan III FPGA booting
authorMatthias Fuchs <matthias.fuchs@esd.eu>
Sun, 15 Feb 2009 21:29:15 +0000 (22:29 +0100)
committerWolfgang Denk <wd@denx.de>
Sat, 21 Feb 2009 21:52:44 +0000 (22:52 +0100)
This patch does some minor fixing of the Xilinx Spartan III
FPGA boot code:

- Fixed call order of post configuration callback and
  success message printing (result of copy-paste?)
- remove obsolete comment
- minor coding style cleanup

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
drivers/fpga/spartan3.c

index 9ce41f1d2766daed1da0701802bd07ea1c454d7a..8bb244971f1fb6f824b0b13cd966965b8cab9886 100644 (file)
@@ -281,23 +281,18 @@ static int Spartan3_sp_load (Xilinx_desc * desc, void *buf, size_t bsize)
                        }
                }
 
-               if (ret_val == FPGA_SUCCESS) {
-#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
-                       puts ("Done.\n");
-#endif
-               }
                /*
                 * Run the post configuration function if there is one.
                 */
-               if (*fn->post) {
+               if (*fn->post)
                        (*fn->post) (cookie);
-               }
 
-               else {
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
+               if (ret_val == FPGA_SUCCESS)
+                       puts ("Done.\n");
+               else
                        puts ("Fail.\n");
 #endif
-               }
 
        } else {
                printf ("%s: NULL Interface function table!\n", __FUNCTION__);
@@ -567,17 +562,14 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
                /*
                 * Run the post configuration function if there is one.
                 */
-               if (*fn->post) {
+               if (*fn->post)
                        (*fn->post) (cookie);
-               }
 
 #ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
-               if (ret_val == FPGA_SUCCESS) {
+               if (ret_val == FPGA_SUCCESS)
                        puts ("Done.\n");
-               }
-               else {
+               else
                        puts ("Fail.\n");
-               }
 #endif
 
        } else {