]>
Commit | Line | Data |
---|---|---|
7bfc31f3 GKH |
1 | From d969de8d83401683420638c8107dcfedb2146f37 Mon Sep 17 00:00:00 2001 |
2 | From: Roel Kluin <roel.kluin@gmail.com> | |
3 | Date: Mon, 14 Oct 2013 23:21:15 +0200 | |
4 | Subject: serial: vt8500: add missing braces | |
5 | ||
6 | From: Roel Kluin <roel.kluin@gmail.com> | |
7 | ||
8 | commit d969de8d83401683420638c8107dcfedb2146f37 upstream. | |
9 | ||
10 | Due to missing braces on an if statement, in presence of a device_node a | |
11 | port was always assigned -1, regardless of any alias entries in the | |
12 | device tree. Conversely, if device_node was NULL, an unitialized port | |
13 | ended up being used. | |
14 | ||
15 | This patch adds the missing braces, fixing the issues. | |
16 | ||
17 | Signed-off-by: Roel Kluin <roel.kluin@gmail.com> | |
18 | Acked-by: Tony Prisk <linux@prisktech.co.nz> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
20 | ||
21 | --- | |
22 | drivers/tty/serial/vt8500_serial.c | 5 +++-- | |
23 | 1 file changed, 3 insertions(+), 2 deletions(-) | |
24 | ||
25 | --- a/drivers/tty/serial/vt8500_serial.c | |
26 | +++ b/drivers/tty/serial/vt8500_serial.c | |
27 | @@ -559,12 +559,13 @@ static int vt8500_serial_probe(struct pl | |
28 | if (!mmres || !irqres) | |
29 | return -ENODEV; | |
30 | ||
31 | - if (np) | |
32 | + if (np) { | |
33 | port = of_alias_get_id(np, "serial"); | |
34 | if (port >= VT8500_MAX_PORTS) | |
35 | port = -1; | |
36 | - else | |
37 | + } else { | |
38 | port = -1; | |
39 | + } | |
40 | ||
41 | if (port < 0) { | |
42 | /* calculate the port id */ |