summaryrefslogtreecommitdiff
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2015-02-27 13:21:14 -0600
committerFelipe Balbi <balbi@ti.com>2015-03-10 15:33:32 -0500
commitaf63429cf046210d7313805b579dd779d10ad1c0 (patch)
tree1fb9054072c44aafcb6e5a71de648cb2fc5a15d7 /drivers/usb/musb
parent1b61625f8b5d87caf9633d7dbfbaf1ea8270036d (diff)
usb: musb: cppi41: exit early when tx fifo is empty
as soon as we find out tx fifo is empty, there's no need to break out of the loop just to have another branch to complete the transfer. We can just complete transfer and exit early. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_cppi41.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index 73ac9835485d..4407f30d0b86 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -280,19 +280,15 @@ static void cppi41_dma_callback(void *private_data)
do {
empty = musb_is_tx_fifo_empty(hw_ep);
- if (empty)
- break;
+ if (empty) {
+ cppi41_trans_done(cppi41_channel);
+ goto out;
+ }
wait--;
if (!wait)
break;
udelay(1);
} while (1);
-
- empty = musb_is_tx_fifo_empty(hw_ep);
- if (empty) {
- cppi41_trans_done(cppi41_channel);
- goto out;
- }
}
list_add_tail(&cppi41_channel->tx_check,
&controller->early_tx_list);