diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2013-10-14 23:21:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-04 04:31:06 -0800 |
commit | bfddde1b4056f5b7d0d365606000df3442b82cd0 (patch) | |
tree | 04e3a1f07fa45d8f5b0c214db687b01b12dda4f7 | |
parent | add8ec07b2a000af11be64a89b99afc8c90797e5 (diff) | |
download | lwn-bfddde1b4056f5b7d0d365606000df3442b82cd0.tar.gz lwn-bfddde1b4056f5b7d0d365606000df3442b82cd0.zip |
serial: vt8500: add missing braces
commit d969de8d83401683420638c8107dcfedb2146f37 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/vt8500_serial.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 1a8bc2275ea4..f72b43fbbef9 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -559,12 +559,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 */ |