diff mbox series

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

Message ID e614e49d88b9ccf0e4e0e2a7a37514edf5c5d0e5.1617178642.git.michal.simek@xilinx.com
State Accepted
Commit 74fe3f2ef3d66d1eaf4564467c9a34bfe3561d30
Delegated to: Michal Simek
Headers show
Series xilinx: Align usb dfu boot mode and bootcommand with distroboot | expand

Commit Message

Michal Simek March 31, 2021, 8:17 a.m. UTC
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@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 mbox series

Patch

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();