So that the dfu command can bail out with an error when usb_gadget_poll fails. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/usb/gadget/dfu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c index e15fc41..5d6d400 100644 --- a/drivers/usb/gadget/dfu.c +++ b/drivers/usb/gadget/dfu.c @@ -682,6 +682,8 @@ static struct usb_composite_driver dfu_driver = { int usb_dfu_register(struct usb_dfu_pdata *pdata) { + int ret; + dfu_devs = pdata->alts; dfu_num_alt = pdata->num_alts; dfu_dev_descriptor.idVendor = pdata->idVendor; @@ -692,7 +694,10 @@ int usb_dfu_register(struct usb_dfu_pdata *pdata) usb_composite_register(&dfu_driver); while (1) { - usb_gadget_poll(); + ret = usb_gadget_poll(); + if (ret < 0) + return ret; + if (ctrlc() || dfudetach) goto out; } -- 1.8.5.3 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox