From 502db325af8664e239be3da47f32d496f3db036f Mon Sep 17 00:00:00 2001
From: Huang Shijie <b32955@freescale.com>
Date: Thu, 15 Nov 2012 16:24:31 +0800
Subject: [PATCH] fix patch
Signed-off-by: Huang Shijie <b32955@freescale.com>
---
drivers/tty/serial/mxs-auart.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
@@ -542,7 +542,7 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s)
dma_cap_mask_t mask;
if (auart_dma_enabled(s))
- return 0;
+ return -EBUSY;
/* We do not get the right DMA channels. */
if (s->dma_channel_rx == -1 || s->dma_channel_rx == -1)
@@ -666,10 +666,21 @@ static void mxs_auart_settermios(struct uart_port *u,
* in mx28.
*/
if (is_imx28_auart(s) && (s->flags & MXS_AUART_DMA_CONFIG)) {
- if (!mxs_auart_dma_init(s))
+ if (!mxs_auart_dma_init(s)) {
/* enable DMA tranfer */
ctrl2 |= AUART_CTRL2_TXDMAE | AUART_CTRL2_RXDMAE
| AUART_CTRL2_DMAONERR;
+
+ /* prepare for the DMA RX. */
+ if (!mxs_auart_dma_prep_rx(s)) {
+ /* Disable the normal RX irq. */
+ writel(AUART_INTR_RXIEN,
+ u->membase + AUART_INTR_CLR);
+ } else {
+ mxs_auart_dma_exit(s);
+ dev_err(s->dev, "DMA failed.\n");
+ }
+ }
}
ctrl2 |= AUART_CTRL2_CTSEN | AUART_CTRL2_RTSEN;
} else {
@@ -687,16 +698,6 @@ static void mxs_auart_settermios(struct uart_port *u,
uart_update_timeout(u, termios->c_cflag, baud);
- /* prepare for the DMA RX. */
- if (auart_dma_enabled(s)) {
- if (!mxs_auart_dma_prep_rx(s)) {
- /* Disable the normal RX interrupt. */
- writel(AUART_INTR_RXIEN, u->membase + AUART_INTR_CLR);
- } else {
- mxs_auart_dma_exit(s);
- dev_err(s->dev, "We can not start up the DMA.\n");
- }
- }
}
static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
--
1.7.0.4