aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunsab.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-21 14:05:45 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-21 14:05:45 -0500
commitd04cdb64212eb5ae6a98026a97dda626e40e8e9a (patch)
treeb6a7dbb21ccfceb915844e9a330b3d3dfcaf3c5b /drivers/serial/sunsab.c
parent2f8600dff2b140096a7df781884e918a16aa90e0 (diff)
parentec1248e70edc5cf7b485efcc7b41e44e10f422e5 (diff)
Merge ../linux-2.6
Diffstat (limited to 'drivers/serial/sunsab.c')
-rw-r--r--drivers/serial/sunsab.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 85664228a0b6..a2fb0c2fb121 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -955,14 +955,13 @@ static struct console sunsab_console = {
955 .index = -1, 955 .index = -1,
956 .data = &sunsab_reg, 956 .data = &sunsab_reg,
957}; 957};
958#define SUNSAB_CONSOLE (&sunsab_console)
959 958
960static void __init sunsab_console_init(void) 959static inline struct console *SUNSAB_CONSOLE(void)
961{ 960{
962 int i; 961 int i;
963 962
964 if (con_is_present()) 963 if (con_is_present())
965 return; 964 return NULL;
966 965
967 for (i = 0; i < num_channels; i++) { 966 for (i = 0; i < num_channels; i++) {
968 int this_minor = sunsab_reg.minor + i; 967 int this_minor = sunsab_reg.minor + i;
@@ -971,13 +970,14 @@ static void __init sunsab_console_init(void)
971 break; 970 break;
972 } 971 }
973 if (i == num_channels) 972 if (i == num_channels)
974 return; 973 return NULL;
975 974
976 sunsab_console.index = i; 975 sunsab_console.index = i;
977 register_console(&sunsab_console); 976
977 return &sunsab_console;
978} 978}
979#else 979#else
980#define SUNSAB_CONSOLE (NULL) 980#define SUNSAB_CONSOLE() (NULL)
981#define sunsab_console_init() do { } while (0) 981#define sunsab_console_init() do { } while (0)
982#endif 982#endif
983 983
@@ -1124,7 +1124,6 @@ static int __init sunsab_init(void)
1124 1124
1125 sunsab_reg.minor = sunserial_current_minor; 1125 sunsab_reg.minor = sunserial_current_minor;
1126 sunsab_reg.nr = num_channels; 1126 sunsab_reg.nr = num_channels;
1127 sunsab_reg.cons = SUNSAB_CONSOLE;
1128 1127
1129 ret = uart_register_driver(&sunsab_reg); 1128 ret = uart_register_driver(&sunsab_reg);
1130 if (ret < 0) { 1129 if (ret < 0) {
@@ -1143,10 +1142,12 @@ static int __init sunsab_init(void)
1143 return ret; 1142 return ret;
1144 } 1143 }
1145 1144
1145 sunsab_reg.tty_driver->name_base = sunsab_reg.minor - 64;
1146
1147 sunsab_reg.cons = SUNSAB_CONSOLE();
1148
1146 sunserial_current_minor += num_channels; 1149 sunserial_current_minor += num_channels;
1147 1150
1148 sunsab_console_init();
1149
1150 for (i = 0; i < num_channels; i++) { 1151 for (i = 0; i < num_channels; i++) {
1151 struct uart_sunsab_port *up = &sunsab_ports[i]; 1152 struct uart_sunsab_port *up = &sunsab_ports[i];
1152 1153