[PATCH] serial: samsung: Fix setting of per-channel fifo sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the existing code, the optional fifosizes property passed via device
tree was being overwritten. Ensure the setting of correct fifo sizes for
both dt and non-dt cases.

Signed-off-by: Abhilash Kesavan <a.kesavan@xxxxxxxxxxx>
---
 drivers/tty/serial/samsung.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index af821a9..e04bb5e 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1827,14 +1827,23 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 			dev_get_platdata(&pdev->dev) :
 			ourport->drv_data->def_cfg;
 
-	if (np)
-		of_property_read_u32(np,
-			"samsung,uart-fifosize", &ourport->port.fifosize);
-
-	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 (np) {
+		if (of_property_read_u32(np,
+			"samsung,uart-fifosize", &ourport->port.fifosize)) {
+			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;
+		}
+	} else {
+		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;
+	}
 
 	probe_index++;
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux