diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-21 12:08:21 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-21 12:08:21 -0500 |
| commit | ac58c9059da8886b5e8cde012a80266b18ca146e (patch) | |
| tree | 40bf486843a2cace6c3a959d73423e50e6aa0c00 /drivers/serial/sunzilog.c | |
| parent | df6db302cb236ac3a683d535a3e2073d9f4b2833 (diff) | |
| parent | c4a1745aa09fc110afdefea0e5d025043e348bae (diff) | |
Merge branch 'linus'
Diffstat (limited to 'drivers/serial/sunzilog.c')
| -rw-r--r-- | drivers/serial/sunzilog.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 5cc4d4c2935c..10b35c6f287d 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
| @@ -1390,7 +1390,6 @@ static struct console sunzilog_console = { | |||
| 1390 | .index = -1, | 1390 | .index = -1, |
| 1391 | .data = &sunzilog_reg, | 1391 | .data = &sunzilog_reg, |
| 1392 | }; | 1392 | }; |
| 1393 | #define SUNZILOG_CONSOLE (&sunzilog_console) | ||
| 1394 | 1393 | ||
| 1395 | static int __init sunzilog_console_init(void) | 1394 | static int __init sunzilog_console_init(void) |
| 1396 | { | 1395 | { |
| @@ -1413,8 +1412,31 @@ static int __init sunzilog_console_init(void) | |||
| 1413 | register_console(&sunzilog_console); | 1412 | register_console(&sunzilog_console); |
| 1414 | return 0; | 1413 | return 0; |
| 1415 | } | 1414 | } |
| 1415 | |||
| 1416 | static inline struct console *SUNZILOG_CONSOLE(void) | ||
| 1417 | { | ||
| 1418 | int i; | ||
| 1419 | |||
| 1420 | if (con_is_present()) | ||
| 1421 | return NULL; | ||
| 1422 | |||
| 1423 | for (i = 0; i < NUM_CHANNELS; i++) { | ||
| 1424 | int this_minor = sunzilog_reg.minor + i; | ||
| 1425 | |||
| 1426 | if ((this_minor - 64) == (serial_console - 1)) | ||
| 1427 | break; | ||
| 1428 | } | ||
| 1429 | if (i == NUM_CHANNELS) | ||
| 1430 | return NULL; | ||
| 1431 | |||
| 1432 | sunzilog_console.index = i; | ||
| 1433 | sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS; | ||
| 1434 | |||
| 1435 | return &sunzilog_console; | ||
| 1436 | } | ||
| 1437 | |||
| 1416 | #else | 1438 | #else |
| 1417 | #define SUNZILOG_CONSOLE (NULL) | 1439 | #define SUNZILOG_CONSOLE() (NULL) |
| 1418 | #define sunzilog_console_init() do { } while (0) | 1440 | #define sunzilog_console_init() do { } while (0) |
| 1419 | #endif | 1441 | #endif |
| 1420 | 1442 | ||
| @@ -1666,14 +1688,15 @@ static int __init sunzilog_ports_init(void) | |||
| 1666 | } | 1688 | } |
| 1667 | 1689 | ||
| 1668 | sunzilog_reg.nr = uart_count; | 1690 | sunzilog_reg.nr = uart_count; |
| 1669 | sunzilog_reg.cons = SUNZILOG_CONSOLE; | ||
| 1670 | |||
| 1671 | sunzilog_reg.minor = sunserial_current_minor; | 1691 | sunzilog_reg.minor = sunserial_current_minor; |
| 1672 | sunserial_current_minor += uart_count; | ||
| 1673 | 1692 | ||
| 1674 | ret = uart_register_driver(&sunzilog_reg); | 1693 | ret = uart_register_driver(&sunzilog_reg); |
| 1675 | if (ret == 0) { | 1694 | if (ret == 0) { |
| 1676 | sunzilog_console_init(); | 1695 | sunzilog_reg.tty_driver->name_base = sunzilog_reg.minor - 64; |
| 1696 | sunzilog_reg.cons = SUNZILOG_CONSOLE(); | ||
| 1697 | |||
| 1698 | sunserial_current_minor += uart_count; | ||
| 1699 | |||
| 1677 | for (i = 0; i < NUM_CHANNELS; i++) { | 1700 | for (i = 0; i < NUM_CHANNELS; i++) { |
| 1678 | struct uart_sunzilog_port *up = &sunzilog_port_table[i]; | 1701 | struct uart_sunzilog_port *up = &sunzilog_port_table[i]; |
| 1679 | 1702 | ||
