]> git.sur5r.net Git - u-boot/commitdiff
usb:gadget:f_thor: download_tail(): remove dfu_write with 0 size
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Mon, 12 May 2014 10:05:34 +0000 (12:05 +0200)
committerMarek Vasut <marex@denx.de>
Wed, 14 May 2014 22:23:56 +0000 (00:23 +0200)
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 <p.marczak@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Marek Vasut <marex@denx.de>
drivers/usb/gadget/f_thor.c

index feef9e4619c482c31d7ce5a45bbab55a772c6146..28f215e07c6efa34e16ce2af151b23dc47e4fdc6 100644 (file)
@@ -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;
 }