Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af63429c authored by Felipe Balbi's avatar Felipe Balbi
Browse files

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: default avatarFelipe Balbi <balbi@ti.com>
parent 1b61625f
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -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);