summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_gadget_ep0.c
diff options
context:
space:
mode:
authorRavi Babu2013-04-02 09:52:42 +0200
committerFelipe Balbi2013-04-02 10:42:50 +0200
commit538bf07d897008e87eca49cde5970545f3814ac7 (patch)
treebd1e62f349ab838c9f494184f5da9ee199671fff /drivers/usb/musb/musb_gadget_ep0.c
parentusb: musb: dsps: print babble message only when musb is active host (diff)
downloadkernel-qcow2-linux-538bf07d897008e87eca49cde5970545f3814ac7.tar.gz
kernel-qcow2-linux-538bf07d897008e87eca49cde5970545f3814ac7.tar.xz
kernel-qcow2-linux-538bf07d897008e87eca49cde5970545f3814ac7.zip
usb: musb: gadget: read ep0 fifo only if rxcount is non zero
avoid reading fifo rxcount is zero of fifo is empty, hence read fifo only if rxcount is non-zero Signed-off-by: Ravi Babu <ravibabu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_gadget_ep0.c')
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index c9c1ac4e075f..2af45a0c8930 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -505,8 +505,10 @@ static void ep0_rxstate(struct musb *musb)
req->status = -EOVERFLOW;
count = len;
}
- musb_read_fifo(&musb->endpoints[0], count, buf);
- req->actual += count;
+ if (count > 0) {
+ musb_read_fifo(&musb->endpoints[0], count, buf);
+ req->actual += count;
+ }
csr = MUSB_CSR0_P_SVDRXPKTRDY;
if (count < 64 || req->actual == req->length) {
musb->ep0_state = MUSB_EP0_STAGE_STATUSIN;