aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunzilog.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-20 14:57:50 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-20 14:57:50 -0500
commitc4a1745aa09fc110afdefea0e5d025043e348bae (patch)
tree6d28dc3a0c1bf18437b3d49f28e5c81b850cdb2f /drivers/serial/sunzilog.c
parent88dcb91177cfa5b26143a29074389a2aa259c7cf (diff)
parentac0eb3eb7e54b700386068be025a43d2a3958ee5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (230 commits) [SPARC64]: Update defconfig. [SPARC64]: Fix 2 bugs in huge page support. [SPARC64]: CONFIG_BLK_DEV_RAM fix [SPARC64]: Optimized TSB table initialization. [SPARC64]: Allow CONFIG_MEMORY_HOTPLUG to build. [SPARC64]: Use SLAB caches for TSB tables. [SPARC64]: Don't kill the page allocator when growing a TSB. [SPARC64]: Randomize mm->mmap_base when PF_RANDOMIZE is set. [SPARC64]: Increase top of 32-bit process stack. [SPARC64]: Top-down address space allocation for 32-bit tasks. [SPARC64] bbc_i2c: Fix cpu check and add missing module license. [SPARC64]: Fix and re-enable dynamic TSB sizing. [SUNSU]: Fix missing spinlock initialization. [TG3]: Do not try to access NIC_SRAM_DATA_SIG on Sun parts. [SPARC64]: First cut at VIS simulator for Niagara. [SPARC64]: Fix system type in /proc/cpuinfo and remove bogus OBP check. [SPARC64]: Add SMT scheduling support for Niagara. [SPARC64]: Fix 32-bit truncation which broke sparsemem. [SPARC64]: Move over to sparsemem. [SPARC64]: Fix new context version SMP handling. ...
Diffstat (limited to 'drivers/serial/sunzilog.c')
-rw-r--r--drivers/serial/sunzilog.c35
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
1395static int __init sunzilog_console_init(void) 1394static 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
1416static 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