cmd: dfu: Propagate error if dfu gadget fails
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>
diff --git a/cmd/dfu.c b/cmd/dfu.c
index ef4f897..4a288f7 100644
--- a/cmd/dfu.c
+++ b/cmd/dfu.c
@@ -68,7 +68,7 @@
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();