Skip to content

Commit 068b512

Browse files
Villemoesgregkh
authored andcommitted
serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
When 7c7f9bc ("serial: Deassert Transmit Enable on probe in driver-specific way") got backported to 5.15.y, there known as b079d37, some hunks were accidentally left out. In fsl_lpuart.c, this amounts to uart_remove_one_port() being called in an error path despite uart_add_one_port() not having been called. In serial_core.c, it is possible that the omission in uart_suspend_port() is harmless, but the backport did have the corresponding hunk in uart_resume_port(), it runs counter to the original commit's intention of Skip any invocation of ->set_mctrl() if RS485 is enabled. and it's certainly better to be aligned with upstream. Fixes: b079d37 ("serial: Deassert Transmit Enable on probe in driver-specific way") Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Reviewed-by: Dominique MARTINET <dominique.martinet@atmark-techno.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 46aa155 commit 068b512

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2784,9 +2784,9 @@ static int lpuart_probe(struct platform_device *pdev)
27842784
return 0;
27852785

27862786
failed_irq_request:
2787-
failed_get_rs485:
27882787
uart_remove_one_port(&lpuart_reg, &sport->port);
27892788
failed_attach_port:
2789+
failed_get_rs485:
27902790
failed_reset:
27912791
lpuart_disable_clks(sport);
27922792
return ret;

drivers/tty/serial/serial_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,7 +2225,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
22252225

22262226
spin_lock_irq(&uport->lock);
22272227
ops->stop_tx(uport);
2228-
ops->set_mctrl(uport, 0);
2228+
if (!(uport->rs485.flags & SER_RS485_ENABLED))
2229+
ops->set_mctrl(uport, 0);
22292230
ops->stop_rx(uport);
22302231
spin_unlock_irq(&uport->lock);
22312232

0 commit comments

Comments
 (0)