[PATCH 1/6] cmd: dfu: Propagate error if dfu gadget fails

Michal Simek michal.simek at xilinx.com
Wed Mar 31 10:17:20 CEST 2021


On systems without usb gadget dfu core fails which was reported by error
but command itself returns pass which breaks any usage in a script.
That's why propagate error from run_usb_dnl_gadget().

Fixes: 16297cfb2a20 ("usb: new board-specific USB init interface")
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

Before this patch

ZynqMP> run bootcmd_usb_dfu0
No USB device found
usb_gadget_initialize failed
DFU0: Trying to boot script at 0x20000000
Wrong image format for "source" command
DFU0: SCRIPT FAILED: continuing...

After
ZynqMP> run bootcmd_usb_dfu0
No USB device found
usb_gadget_initialize failed
DFU0: SCRIPT FAILED: continuing...

---
 cmd/dfu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/dfu.c b/cmd/dfu.c
index ef4f897ce070..4a288f74c2c2 100644
--- a/cmd/dfu.c
+++ b/cmd/dfu.c
@@ -68,7 +68,7 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	int controller_index = simple_strtoul(usb_controller, NULL, 0);
 	bool retry = false;
 	do {
-		run_usb_dnl_gadget(controller_index, "usb_dnl_dfu");
+		ret = run_usb_dnl_gadget(controller_index, "usb_dnl_dfu");
 
 		if (dfu_reinit_needed) {
 			dfu_free_entities();
-- 
2.31.0



More information about the U-Boot mailing list