serial: imx: only set dma_is_rxing when DMA starts
authorRomain Perier <romain.perier@collabora.com>
Thu, 28 Sep 2017 10:03:49 +0000 (11:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Oct 2017 18:27:13 +0000 (20:27 +0200)
commit4139fd76cd92b350114b102f1b40b02381b198cf
tree42a4eb7e528d7878ac068c8dd584e122d72c16b7
parent177b508f3c7694647e94509a1ef3f5a139deac50
serial: imx: only set dma_is_rxing when DMA starts

The variable dma_is_rxing is currently set to 1 in imx_disable_rx_int().
This is problematic as:

- whilst imx_disable_rx_int() is currently always called before
  start_rx_dma() this dependency isn't obvious.
- start_rx_dma() does error checking and might exit without
  enabling DMA. Currently this will result in dma_is_rxing suggesting
  that DMA is being used for recieving.

To avoid these issues, move the setting of dma_is_rxing to
start_rx_dma() when appropriate.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c