Browse Source

common: Fix logic in fpga programming

Stop boot process if fpga programming fails.
Without this patch boot process continues even if fpga programming
failed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Michal Simek 7 years ago
parent
commit
611a9428c7
1 changed files with 3 additions and 4 deletions
  1. 3 4
      common/image.c

+ 3 - 4
common/image.c

@@ -1375,11 +1375,10 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
 						img_len, BIT_PARTIAL);
 		}
 
-		printf("   Programming %s bitstream... ", name);
 		if (err)
-			printf("failed\n");
-		else
-			printf("OK\n");
+			return err;
+
+		printf("   Programming %s bitstream... OK\n", name);
 		break;
 	default:
 		printf("The given image format is not supported (corrupt?)\n");