[v2,2/2] tty: serial: fsl_lpuart: fix return value checking
diff mbox series

Message ID 20200325090658.25967-2-michael@walle.cc
State Accepted
Commit d7c53fb081c6347675bcd6fc4a9306111c42c111
Headers show
Series
  • [v2,1/2] tty: serial: fsl_lpuart: move dma_request_chan()
Related show

Commit Message

Michael Walle March 25, 2020, 9:06 a.m. UTC
The return value of lpuart_dma_tx_request() is an negative errno on
failure and zero on success.

Fixes: 159381df1442f ("tty: serial: fsl_lpuart: fix DMA operation when using IOMMU")
Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Michael Walle <michael@walle.cc>
---
changes since v1:
 - none

 drivers/tty/serial/fsl_lpuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Duan March 25, 2020, 10:07 a.m. UTC | #1
From: Michael Walle <michael@walle.cc> Sent: Wednesday, March 25, 2020 5:07 PM
> The return value of lpuart_dma_tx_request() is an negative errno on failure
> and zero on success.
> 
> Fixes: 159381df1442f ("tty: serial: fsl_lpuart: fix DMA operation when using
> IOMMU")
> Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
> Signed-off-by: Michael Walle <michael@walle.cc>

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
> ---
> changes since v1:
>  - none
> 
>  drivers/tty/serial/fsl_lpuart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index
> 131018979b77..5d41075964f2 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -1538,7 +1538,7 @@ static void lpuart_tx_dma_startup(struct
> lpuart_port *sport)
>                 goto err;
> 
>         ret = lpuart_dma_tx_request(&sport->port);
> -       if (!ret)
> +       if (ret)
>                 goto err;
> 
>         init_waitqueue_head(&sport->dma_wait);
> --
> 2.20.1

Patch
diff mbox series

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 131018979b77..5d41075964f2 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1538,7 +1538,7 @@  static void lpuart_tx_dma_startup(struct lpuart_port *sport)
 		goto err;
 
 	ret = lpuart_dma_tx_request(&sport->port);
-	if (!ret)
+	if (ret)
 		goto err;
 
 	init_waitqueue_head(&sport->dma_wait);