USB: gadget: f_mtp: Return zero result for successful file transfer.
Returning number of bytes transfered does not work for files > 2 gig
since ioctl() result is a signed integer.
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c
index 81075f2..81cc018 100644
--- a/drivers/usb/gadget/f_mtp.c
+++ b/drivers/usb/gadget/f_mtp.c
@@ -621,15 +621,16 @@
struct file *filp;
loff_t offset;
size_t count;
- int r, xfer, ret;
+ int xfer, ret;
+ int r = 0;
/* read our parameters */
smp_rmb();
filp = dev->xfer_file;
offset = dev->xfer_file_offset;
- r = count = dev->xfer_file_length;
+ count = dev->xfer_file_length;
- DBG(cdev, "send_file_work(%lld %d)\n", offset, count);
+ DBG(cdev, "send_file_work(%lld %u)\n", offset, count);
while (count > 0) {
/* get an idle tx request to use */
@@ -686,15 +687,16 @@
struct file *filp;
loff_t offset;
size_t count;
- int r, ret, cur_buf = 0;
+ int ret, cur_buf = 0;
+ int r = 0;
/* read our parameters */
smp_rmb();
filp = dev->xfer_file;
offset = dev->xfer_file_offset;
- r = count = dev->xfer_file_length;
+ count = dev->xfer_file_length;
- DBG(cdev, "receive_file_work(%d)\n", count);
+ DBG(cdev, "receive_file_work(%u)\n", count);
while (count > 0 || write_req) {
if (count > 0) {