summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/samsung_tty.c
diff options
context:
space:
mode:
authorTamseel Shams <m.shams@samsung.com>2024-02-20 15:42:27 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-02 22:04:05 +0100
commitb8a4ed3405d5f3f92a211ccc2579e54345bc3aeb (patch)
treeff63d80a3da6791451f1e3d065fbb7c2dd1d2b07 /drivers/tty/serial/samsung_tty.c
parentf75a010dcba0270c403cb680a0c662293dd98a60 (diff)
downloadlinux-stable-b8a4ed3405d5f3f92a211ccc2579e54345bc3aeb.tar.gz
linux-stable-b8a4ed3405d5f3f92a211ccc2579e54345bc3aeb.tar.bz2
linux-stable-b8a4ed3405d5f3f92a211ccc2579e54345bc3aeb.zip
serial: samsung: honor fifosize from dts at first
Currently for platforms which passes UART fifosize from DT gets override by local driver structure "s3c24xx_serial_drv_data", which is not intended. Change the code to honor fifosize from device tree at first. Signed-off-by: Tamseel Shams <m.shams@samsung.com> Link: https://lore.kernel.org/r/20240220101227.80741-1-m.shams@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/samsung_tty.c')
-rw-r--r--drivers/tty/serial/samsung_tty.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 23cabdab44ff..a2d07e05c502 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -1951,7 +1951,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct s3c24xx_uart_port *ourport;
int index = probe_index;
- int ret, prop = 0;
+ int ret, prop = 0, fifosize_prop = 1;
if (np) {
ret = of_alias_get_id(np, "serial");
@@ -1991,8 +1991,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
ourport->port.iotype = ourport->info->iotype;
if (np) {
- of_property_read_u32(np,
- "samsung,uart-fifosize", &ourport->port.fifosize);
+ fifosize_prop = of_property_read_u32(np, "samsung,uart-fifosize",
+ &ourport->port.fifosize);
if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
switch (prop) {
@@ -2010,10 +2010,13 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
}
}
- if (ourport->drv_data->fifosize[index])
- ourport->port.fifosize = ourport->drv_data->fifosize[index];
- else if (ourport->info->fifosize)
- ourport->port.fifosize = ourport->info->fifosize;
+ if (fifosize_prop) {
+ if (ourport->drv_data->fifosize[index])
+ ourport->port.fifosize = ourport->drv_data->fifosize[index];
+ else if (ourport->info->fifosize)
+ ourport->port.fifosize = ourport->info->fifosize;
+ }
+
ourport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SAMSUNG_CONSOLE);
/*