[PATCH] serial: zs: Fix swapped RI/DSR modem line transition counting

Maciej W. Rozycki posted 1 patch 2 months ago
drivers/tty/serial/zs.c |    4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] serial: zs: Fix swapped RI/DSR modem line transition counting
Posted by Maciej W. Rozycki 2 months ago
Fix a thinko in the status interrupt handler that has caused counters 
for the RI and DSR modem line transitions to be used for the other line 
each.

Fixes: 8b4a40809e53 ("zs: move to the serial subsystem")
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
---
 drivers/tty/serial/zs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

linux-serial-zs-dsr-rng.diff
Index: linux-macro/drivers/tty/serial/zs.c
===================================================================
--- linux-macro.orig/drivers/tty/serial/zs.c
+++ linux-macro/drivers/tty/serial/zs.c
@@ -679,9 +679,9 @@ static void zs_status_handle(struct zs_p
 			uart_handle_dcd_change(uport,
 					       zport->mctrl & TIOCM_CAR);
 		if (delta & TIOCM_RNG)
-			uport->icount.dsr++;
-		if (delta & TIOCM_DSR)
 			uport->icount.rng++;
+		if (delta & TIOCM_DSR)
+			uport->icount.dsr++;
 
 		if (delta)
 			wake_up_interruptible(&uport->state->port.delta_msr_wait);