summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2013-10-14 23:21:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-16 13:22:16 -0700
commitd969de8d83401683420638c8107dcfedb2146f37 (patch)
tree23daf8d46a552ae5105e9365be573d1e6e98fe98 /drivers/tty
parentb4e788df8d8132d25a76c22df340ab2e4bae630f (diff)
downloadlinux-rpi3-d969de8d83401683420638c8107dcfedb2146f37.tar.gz
linux-rpi3-d969de8d83401683420638c8107dcfedb2146f37.tar.bz2
linux-rpi3-d969de8d83401683420638c8107dcfedb2146f37.zip
serial: vt8500: add missing braces
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 <roel.kluin@gmail.com> Acked-by: Tony Prisk <linux@prisktech.co.nz> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/vt8500_serial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c
index 93b697a0de65..15ad6fcda88b 100644
--- a/drivers/tty/serial/vt8500_serial.c
+++ b/drivers/tty/serial/vt8500_serial.c
@@ -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 */