]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/musb/musb_host.c
musb_hdrc: Fixes before pulling from mainline tree
[linux-2.6-omap-h63xx.git] / drivers / usb / musb / musb_host.c
index e9c766f06a2e6c9db70122ddd8bb2e2e5ef84509..08e421fa363be0a36ec2cd9d54d83f4c73a331b5 100644 (file)
@@ -422,7 +422,11 @@ musb_advance_schedule(struct musb *musb, struct urb *urb,
                qh = hw_ep->in_qh;
        else
                qh = hw_ep->out_qh;
-       qh = musb_giveback(qh, urb, 0);
+
+       if (urb->status == -EINPROGRESS)
+               qh = musb_giveback(qh, urb, 0);
+       else
+               qh = musb_giveback(qh, urb, urb->status);
 
        if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) {
                DBG(4, "... next ep%d %cX urb %p\n",
@@ -580,7 +584,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep)
        } else {
                csr = musb_readw(ep->regs, MUSB_RXCSR);
                if (csr & MUSB_RXCSR_RXPKTRDY)
-                       WARN("rx%d, packet/%d ready?\n", ep->epnum,
+                       WARNING("rx%d, packet/%d ready?\n", ep->epnum,
                                musb_readw(ep->regs, MUSB_RXCOUNT));
 
                musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
@@ -1399,7 +1403,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
 
        pipe = urb->pipe;
 
-       DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zd)\n",
+       DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)\n",
                epnum, rx_csr, urb->actual_length,
                dma ? dma->actual_len : 0);
 
@@ -1449,7 +1453,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
                        (void) musb->dma_controller->channel_abort(dma);
                        xfer_len = dma->actual_len;
                }
-               musb_h_flush_rxfifo(hw_ep, 0);
+               musb_h_flush_rxfifo(hw_ep, MUSB_RXCSR_CLRDATATOG);
                musb_writeb(epio, MUSB_RXINTERVAL, 0);
                done = true;
                goto finish;
@@ -1482,7 +1486,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
                        done = true;
                }
 
-               DBG(2, "RXCSR%d %04x, reqpkt, len %zd%s\n", epnum, rx_csr,
+               DBG(2, "RXCSR%d %04x, reqpkt, len %zu%s\n", epnum, rx_csr,
                                xfer_len, dma ? ", dma" : "");
                rx_csr &= ~MUSB_RXCSR_H_REQPKT;
 
@@ -2121,7 +2125,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
                return 0;
 
        if (is_host_active(musb) && musb->is_active) {
-               WARN("trying to suspend as %s is_active=%i\n",
+               WARNING("trying to suspend as %s is_active=%i\n",
                        otg_state_string(musb), musb->is_active);
                return -EBUSY;
        } else