[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231209125836.16294-7-l.sanfilippo@kunbus.com>
Date: Sat, 9 Dec 2023 13:58:35 +0100
From: Lino Sanfilippo <l.sanfilippo@...bus.com>
To: gregkh@...uxfoundation.org, jirislaby@...nel.org,
ilpo.jarvinen@...ux.intel.com
Cc: u.kleine-koenig@...gutronix.de, shawnguo@...nel.org,
s.hauer@...gutronix.de, mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com, cniedermaier@...electronics.com,
hugo@...ovil.com, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org, LinoSanfilippo@....de,
lukas@...ner.de, p.rosenberger@...bus.com,
Lino Sanfilippo <l.sanfilippo@...bus.com>,
stable@...r.kernel.org
Subject: [PATCH v5 6/7] serial: omap: do not override settings for RS485 support
In serial_omap_rs485() RS485 support may be deactivated due to a missing
RTS GPIO. This is done by nullifying the ports rs485_supported struct.
After that however the serial_omap_rs485_supported struct is assigned to
the same structure unconditionally, which results in an unintended
reactivation of RS485 support.
Fix this by callling serial_omap_rs485() after the assignment of
rs485_supported.
Fixes: e2752ae3cfc9 ("serial: omap: Disallow RS-485 if rts-gpio is not specified")
Cc: stable@...r.kernel.org
Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
---
drivers/tty/serial/omap-serial.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index ad4c1c5d0a7f..d9b2936308c4 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1604,10 +1604,6 @@ static int serial_omap_probe(struct platform_device *pdev)
dev_info(up->port.dev, "no wakeirq for uart%d\n",
up->port.line);
- ret = serial_omap_probe_rs485(up, &pdev->dev);
- if (ret < 0)
- goto err_rs485;
-
sprintf(up->name, "OMAP UART%d", up->port.line);
up->port.mapbase = mem->start;
up->port.membase = base;
@@ -1622,6 +1618,10 @@ static int serial_omap_probe(struct platform_device *pdev)
DEFAULT_CLK_SPEED);
}
+ ret = serial_omap_probe_rs485(up, &pdev->dev);
+ if (ret < 0)
+ goto err_rs485;
+
up->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
up->calc_latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
cpu_latency_qos_add_request(&up->pm_qos_request, up->latency);
--
2.42.0
Powered by blists - more mailing lists