usb: musb: tusb6010_omap: Use one musb_ep_select call in tusb_omap_dma_program
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 16 Jun 2017 15:40:58 +0000 (10:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jun 2017 03:45:01 +0000 (11:45 +0800)
Having one musb_ep_select() instead the two calls in if/else is the same
thing, but makes the code a bit simpler to follow.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/tusb6010_omap.c

index 7870b37e0ea5c6b5a1767e9469193d791107071c..025b52e0b34d5a47babd1c11c72ac326883f605d 100644 (file)
@@ -368,15 +368,14 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
        /*
         * Prepare MUSB for DMA transfer
         */
+       musb_ep_select(mbase, chdat->epnum);
        if (chdat->tx) {
-               musb_ep_select(mbase, chdat->epnum);
                csr = musb_readw(hw_ep->regs, MUSB_TXCSR);
                csr |= (MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAENAB
                        | MUSB_TXCSR_DMAMODE | MUSB_TXCSR_MODE);
                csr &= ~MUSB_TXCSR_P_UNDERRUN;
                musb_writew(hw_ep->regs, MUSB_TXCSR, csr);
        } else {
-               musb_ep_select(mbase, chdat->epnum);
                csr = musb_readw(hw_ep->regs, MUSB_RXCSR);
                csr |= MUSB_RXCSR_DMAENAB;
                csr &= ~(MUSB_RXCSR_AUTOCLEAR | MUSB_RXCSR_DMAMODE);