[PATCH 4/4] USB gadget: dfu: propagate error from usb_gadget_poll

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 13 04:42:53 EST 2014


So that the dfu command can bail out with an error when usb_gadget_poll
fails.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 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




More information about the barebox mailing list