2022-04-12 05:50:30

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 3/3] tty: serial: altera: use altera_jtaguart_stop_tx()

altera_jtaguart_tx_chars() duplicates what altera_jtaguart_stop_tx()
already does. So instead of the duplication, call the helper instead.

Not only it makes the code cleaner, but it also says what the "if"
really does.

Cc: Tobias Klauser <[email protected]>
Signed-off-by: Jiri Slaby <[email protected]>
---
drivers/tty/serial/altera_jtaguart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index 1c16345d0a1f..cb791c5149a3 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -168,10 +168,8 @@ static void altera_jtaguart_tx_chars(struct altera_jtaguart *pp)
}
}

- if (pending == 0) {
- pp->imr &= ~ALTERA_JTAGUART_CONTROL_WE_MSK;
- writel(pp->imr, port->membase + ALTERA_JTAGUART_CONTROL_REG);
- }
+ if (pending == 0)
+ altera_jtaguart_stop_tx(port);
}

static irqreturn_t altera_jtaguart_interrupt(int irq, void *data)
--
2.35.1


2022-04-12 19:59:27

by Tobias Klauser

[permalink] [raw]
Subject: Re: [PATCH 3/3] tty: serial: altera: use altera_jtaguart_stop_tx()

On 2022-04-11 at 12:45:06 +0200, Jiri Slaby <[email protected]> wrote:
> altera_jtaguart_tx_chars() duplicates what altera_jtaguart_stop_tx()
> already does. So instead of the duplication, call the helper instead.
>
> Not only it makes the code cleaner, but it also says what the "if"
> really does.
>
> Cc: Tobias Klauser <[email protected]>
> Signed-off-by: Jiri Slaby <[email protected]>

Acked-by: Tobias Klauser <[email protected]>

Thanks