]> Git Repo - linux.git/commitdiff
serial: vt8500: add missing braces
authorRoel Kluin <[email protected]>
Mon, 14 Oct 2013 21:21:15 +0000 (23:21 +0200)
committerGreg Kroah-Hartman <[email protected]>
Wed, 16 Oct 2013 20:22:16 +0000 (13:22 -0700)
Due to missing braces on an if statement, in presence of a device_node a
port was always assigned -1, regardless of any alias entries in the
device tree. Conversely, if device_node was NULL, an unitialized port
ended up being used.

This patch adds the missing braces, fixing the issues.

Signed-off-by: Roel Kluin <[email protected]>
Acked-by: Tony Prisk <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/serial/vt8500_serial.c

index 93b697a0de658ddc6769fedbe822b1151fef4bab..15ad6fcda88b323b2f5711b753ee76126741ea04 100644 (file)
@@ -561,12 +561,13 @@ static int vt8500_serial_probe(struct platform_device *pdev)
        if (!mmres || !irqres)
                return -ENODEV;
 
-       if (np)
+       if (np) {
                port = of_alias_get_id(np, "serial");
                if (port >= VT8500_MAX_PORTS)
                        port = -1;
-       else
+       } else {
                port = -1;
+       }
 
        if (port < 0) {
                /* calculate the port id */
This page took 0.053659 seconds and 4 git commands to generate.