[PATCH 15/23] USB: gadget: DFU: return -EINTR when interrupted

Sascha Hauer s.hauer at pengutronix.de
Mon Jul 21 08:14:39 PDT 2014


Instead of returning succesfully when ctrl-c is pressed return
with -EINTR.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/usb/gadget/dfu.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 1d35f50..ca7462b 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -779,8 +779,15 @@ int usb_dfu_register(struct usb_dfu_pdata *pdata)
 		if (ret < 0)
 			goto out;
 
-		if (ctrlc() || dfudetach)
+		if (dfudetach) {
+			ret = 0;
 			goto out;
+		}
+
+		if (ctrlc()) {
+			ret = -EINTR;
+			goto out;
+		}
 	}
 
 out:
-- 
2.0.1




More information about the barebox mailing list