From: Przemyslaw Marczak
Date: Fri, 18 Apr 2014 07:48:25 +0000 (+0200)
Subject: usb:gadget:f_thor: fix write to filesystem by add dfu_flush()
X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fd2a89b20ba66d76929f672b03f392733fb1b2a6;p=project%2Fbcm63xx%2Fu-boot.git
usb:gadget:f_thor: fix write to filesystem by add dfu_flush()
Since dfu read/write operations needs to be flushed manually,
writing to filesystem on MMC by thor was broken. MMC raw write
actually is working fine because current dfu_flush() function
writes filesystem only. This commit adds dfu_flush() to f_thor
and now filesystem write is working.
This change was tested on Trats2 board.
Signed-off-by: Przemyslaw Marczak
Cc: Lukasz Majewski
Cc: Marek Vasut
Cc: Heiko Schocher
Cc: Tom Rini
---
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index 231f9c0ac7..ba47945007 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -229,6 +229,12 @@ static int download_tail(long long int left, int cnt)
if (ret)
error("DFU write failed [%d] cnt: %d", ret, cnt);
+ ret = dfu_flush(dfu_entity, transfer_buffer, 0, cnt);
+ if (ret) {
+ error("DFU flush failed!");
+ return ret;
+ }
+
return ret;
}