From 584b55b072a94de94b3fe0d54defae87795237d7 Mon Sep 17 00:00:00 2001
From: Przemyslaw Marczak
Date: Mon, 12 May 2014 12:05:34 +0200
Subject: [PATCH] usb:gadget:f_thor: download_tail(): remove dfu_write with 0
size
Since dfu_flush() can write raw data, dfu_write() with zero size
can be removed from download_tail() in thor gadget.
Signed-off-by: Przemyslaw Marczak
Cc: Lukasz Majewski
Cc: Heiko Schocher
Cc: Marek Vasut
---
drivers/usb/gadget/f_thor.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index feef9e4619..28f215e07c 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -219,21 +219,15 @@ static int download_tail(long long int left, int cnt)
}
/*
- * To store last "packet" DFU storage backend requires dfu_write with
- * size parameter equal to 0
+ * To store last "packet" or write file from buffer to filesystem
+ * DFU storage backend requires dfu_flush
*
* This also frees memory malloc'ed by dfu_get_buf(), so no explicit
* need fo call dfu_free_buf() is needed.
*/
- ret = dfu_write(dfu_entity, transfer_buffer, 0, cnt);
- if (ret)
- error("DFU write failed [%d] cnt: %d", ret, cnt);
-
ret = dfu_flush(dfu_entity, transfer_buffer, 0, cnt);
- if (ret) {
+ if (ret)
error("DFU flush failed!");
- return ret;
- }
return ret;
}
--
2.39.5