usb: gadget: dummy_hcd: in transfer(), return data sent, not limit
authorIgor Kotrasinski <i.kotrasinsk@samsung.com>
Tue, 15 Sep 2015 14:55:32 +0000 (16:55 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 21 Sep 2015 19:42:36 +0000 (14:42 -0500)
commit9a9ce1dfaef9aa15980cec22b806b39a65a9467e
treef5bafcb806b1fed4199e07c69612c37f62342684
parente42bd6a54b97e2a39b5004deac66a0fcd6ebbe75
usb: gadget: dummy_hcd: in transfer(), return data sent, not limit

dummy_timer uses transfer() to update transfer limit. However,
limit passed to dummy_timer changes depending on transfer type,
so the actual limit is overwritten.

This can cause unpredictably slow / fast bulk transfers when
coupled with control / interrupt transfers.

Fix by returning actual amount of data sent in transfer() and
substracting from total.

Signed-off-by: Igor Kotrasinski <i.kotrasinsk@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/dummy_hcd.c