summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Smith <gsmith@earthsciencesystems.com>2014-05-22 16:30:27 -0400
committerAnthony Felice <tony.felice@timesys.com>2014-05-29 15:59:00 -0400
commit174ccf8b5fe906f2490d4124c8974e126135d8a3 (patch)
tree8d040bce32be0c05a1abbb26686f331b840e6cf5
parentf2a07e38458e4cba85125b92abd5ff8c04275b2e (diff)
serial/mvf.c: Fix DMA channel deallocation.
Signed-off-by: Anthony Felice <tony.felice@timesys.com>
-rw-r--r--drivers/tty/serial/mvf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/tty/serial/mvf.c b/drivers/tty/serial/mvf.c
index 1b730afd4312..af7c2c91489d 100644
--- a/drivers/tty/serial/mvf.c
+++ b/drivers/tty/serial/mvf.c
@@ -647,10 +647,10 @@ static void imx_shutdown(struct uart_port *port)
if (sport->enable_dma) {
/* We have to wait for the DMA to finish. */
- if (sport->dma_tx_ch) {
+ if (sport->dma_tx_ch >= 0) {
mcf_edma_stop_transfer(sport->dma_tx_ch);
mcf_edma_free_channel(sport->dma_tx_ch, sport);
- sport->dma_tx_ch = 0;
+ sport->dma_tx_ch = -1;
}
}
@@ -797,7 +797,7 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
brfa = ((sport->port.uartclk - (16 * sbr * baud)) * 2)/baud;
bdh &= ~MXC_UARTBDH_SBR_MASK;
- bdh |= (sbr >> 8) & 0x1F;
+ bdh |= (sbr >> 8) & MXC_UARTBDH_SBR_MASK;
cr4 &= ~MXC_UARTCR4_BRFA_MASK;
brfa &= MXC_UARTCR4_BRFA_MASK;
@@ -1259,6 +1259,7 @@ static int serial_imx_probe(struct platform_device *pdev)
if (pdata && (pdata->flags & IMXUART_EDMA))
{
sport->enable_dma = 1;
+ sport->dma_tx_ch = -1;
printk("IMX UART EDMA enabled\n");
}
if (pdata && (pdata->flags & IMXUART_FIFO))