serial: samsung: prefer to use fifosize from driver data
authorRobert Baldyga <r.baldyga@samsung.com>
Mon, 24 Nov 2014 06:56:23 +0000 (07:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2014 01:06:40 +0000 (17:06 -0800)
If we have fifosize set in driver data we prefer to use it instead of default
fifosize value (which is always 16). If there is defined fifosize for particular
serial we prefer to use it, otherwise we use value from info, which is
common for all serials on given platform.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung.c

index 33a953e4cf16d2c8cd341bd643b2a0b29dfe164a..34db16715efc90e4cb760b27d198ca9c6e74d3a1 100644 (file)
@@ -1292,11 +1292,10 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
                of_property_read_u32(np,
                        "samsung,uart-fifosize", &ourport->port.fifosize);
 
-       if (!ourport->port.fifosize) {
-               ourport->port.fifosize = (ourport->info->fifosize) ?
-                       ourport->info->fifosize :
-                       ourport->drv_data->fifosize[index];
-       }
+       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++;