mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 09:12:08 +02:00
cmd: fpga: Use CMD_RET_FAILURE instead of simple 1
Use standard return command failure macro. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
14
cmd/fpga.c
14
cmd/fpga.c
@@ -371,7 +371,7 @@ static int do_fpga_loadmk(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||||||
if (gunzip((void *)data, ~0UL, (void *)image_buf,
|
if (gunzip((void *)data, ~0UL, (void *)image_buf,
|
||||||
&image_size) != 0) {
|
&image_size) != 0) {
|
||||||
puts("GUNZIP: error\n");
|
puts("GUNZIP: error\n");
|
||||||
return 1;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
data_size = image_size;
|
data_size = image_size;
|
||||||
#else
|
#else
|
||||||
@@ -395,32 +395,32 @@ static int do_fpga_loadmk(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||||||
|
|
||||||
if (!fit_uname) {
|
if (!fit_uname) {
|
||||||
puts("No FIT subimage unit name\n");
|
puts("No FIT subimage unit name\n");
|
||||||
return 1;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fit_check_format(fit_hdr)) {
|
if (!fit_check_format(fit_hdr)) {
|
||||||
puts("Bad FIT image format\n");
|
puts("Bad FIT image format\n");
|
||||||
return 1;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get fpga component image node offset */
|
/* get fpga component image node offset */
|
||||||
noffset = fit_image_get_node(fit_hdr, fit_uname);
|
noffset = fit_image_get_node(fit_hdr, fit_uname);
|
||||||
if (noffset < 0) {
|
if (noffset < 0) {
|
||||||
printf("Can't find '%s' FIT subimage\n", fit_uname);
|
printf("Can't find '%s' FIT subimage\n", fit_uname);
|
||||||
return 1;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* verify integrity */
|
/* verify integrity */
|
||||||
if (!fit_image_verify(fit_hdr, noffset)) {
|
if (!fit_image_verify(fit_hdr, noffset)) {
|
||||||
puts("Bad Data Hash\n");
|
puts("Bad Data Hash\n");
|
||||||
return 1;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get fpga subimage data address and length */
|
/* get fpga subimage data address and length */
|
||||||
if (fit_image_get_data(fit_hdr, noffset, &fit_data,
|
if (fit_image_get_data(fit_hdr, noffset, &fit_data,
|
||||||
&data_size)) {
|
&data_size)) {
|
||||||
puts("Fpga subimage data not found\n");
|
puts("Fpga subimage data not found\n");
|
||||||
return 1;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fpga_load(dev, fit_data, data_size, BIT_FULL);
|
return fpga_load(dev, fit_data, data_size, BIT_FULL);
|
||||||
@@ -428,7 +428,7 @@ static int do_fpga_loadmk(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
puts("** Unknown image type\n");
|
puts("** Unknown image type\n");
|
||||||
return FPGA_FAIL;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user