Commit 4e3533d05b6e5e66d1cda27f6671251c99c62894
1 parent
8301d386af
Exists in
master
and in
7 other branches
serial: suncore: Add 'ignore_line' argument to sunserial_console_match().
This tells the logic to ignore the line match when deciding whether the device is the OpenFirmware specified console device or not. This is going to be used in the SU driver for rsc-console detection. There is probably a better way to handle this, but this is the least intrusive solution for now which we can validate won't break any other cases. Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 5 changed files with 21 additions and 15 deletions Side-by-side Diff
drivers/serial/suncore.c
... | ... | @@ -53,20 +53,21 @@ |
53 | 53 | EXPORT_SYMBOL(sunserial_unregister_minors); |
54 | 54 | |
55 | 55 | int sunserial_console_match(struct console *con, struct device_node *dp, |
56 | - struct uart_driver *drv, int line) | |
56 | + struct uart_driver *drv, int line, bool ignore_line) | |
57 | 57 | { |
58 | - int off; | |
59 | - | |
60 | 58 | if (!con || of_console_device != dp) |
61 | 59 | return 0; |
62 | 60 | |
63 | - off = 0; | |
64 | - if (of_console_options && | |
65 | - *of_console_options == 'b') | |
66 | - off = 1; | |
61 | + if (!ignore_line) { | |
62 | + int off = 0; | |
67 | 63 | |
68 | - if ((line & 1) != off) | |
69 | - return 0; | |
64 | + if (of_console_options && | |
65 | + *of_console_options == 'b') | |
66 | + off = 1; | |
67 | + | |
68 | + if ((line & 1) != off) | |
69 | + return 0; | |
70 | + } | |
70 | 71 | |
71 | 72 | con->index = line; |
72 | 73 | drv->cons = con; |
drivers/serial/suncore.h
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | extern void sunserial_unregister_minors(struct uart_driver *, int); |
27 | 27 | |
28 | 28 | extern int sunserial_console_match(struct console *, struct device_node *, |
29 | - struct uart_driver *, int); | |
29 | + struct uart_driver *, int, bool); | |
30 | 30 | extern void sunserial_console_termios(struct console *); |
31 | 31 | |
32 | 32 | #endif /* !(_SERIAL_SUN_H) */ |
drivers/serial/sunsab.c
... | ... | @@ -1027,10 +1027,12 @@ |
1027 | 1027 | goto out1; |
1028 | 1028 | |
1029 | 1029 | sunserial_console_match(SUNSAB_CONSOLE(), op->node, |
1030 | - &sunsab_reg, up[0].port.line); | |
1030 | + &sunsab_reg, up[0].port.line, | |
1031 | + false); | |
1031 | 1032 | |
1032 | 1033 | sunserial_console_match(SUNSAB_CONSOLE(), op->node, |
1033 | - &sunsab_reg, up[1].port.line); | |
1034 | + &sunsab_reg, up[1].port.line, | |
1035 | + false); | |
1034 | 1036 | |
1035 | 1037 | err = uart_add_one_port(&sunsab_reg, &up[0].port); |
1036 | 1038 | if (err) |
drivers/serial/sunsu.c
... | ... | @@ -1468,7 +1468,8 @@ |
1468 | 1468 | up->port.ops = &sunsu_pops; |
1469 | 1469 | |
1470 | 1470 | sunserial_console_match(SUNSU_CONSOLE(), dp, |
1471 | - &sunsu_reg, up->port.line); | |
1471 | + &sunsu_reg, up->port.line, | |
1472 | + false); | |
1472 | 1473 | err = uart_add_one_port(&sunsu_reg, &up->port); |
1473 | 1474 | if (err) |
1474 | 1475 | goto out_unmap; |
drivers/serial/sunzilog.c
... | ... | @@ -1416,7 +1416,8 @@ |
1416 | 1416 | |
1417 | 1417 | if (!keyboard_mouse) { |
1418 | 1418 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, |
1419 | - &sunzilog_reg, up[0].port.line)) | |
1419 | + &sunzilog_reg, up[0].port.line, | |
1420 | + false)) | |
1420 | 1421 | up->flags |= SUNZILOG_FLAG_IS_CONS; |
1421 | 1422 | err = uart_add_one_port(&sunzilog_reg, &up[0].port); |
1422 | 1423 | if (err) { |
... | ... | @@ -1425,7 +1426,8 @@ |
1425 | 1426 | return err; |
1426 | 1427 | } |
1427 | 1428 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, |
1428 | - &sunzilog_reg, up[1].port.line)) | |
1429 | + &sunzilog_reg, up[1].port.line, | |
1430 | + false)) | |
1429 | 1431 | up->flags |= SUNZILOG_FLAG_IS_CONS; |
1430 | 1432 | err = uart_add_one_port(&sunzilog_reg, &up[1].port); |
1431 | 1433 | if (err) { |