aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunhv.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 19:59:26 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 19:59:26 -0400
commitc73fcc846c91f53fd2c67fd9c6c04888a9e5892e (patch)
tree31faa68b4176636756926535a0f50ff780973275 /drivers/serial/sunhv.c
parentede13d81b4dda409a6d271b34b8e2ec9383e255d (diff)
[SPARC]: Fix serial console device detection.
The current scheme works on static interpretation of text names, which is wrong. The output-device setting, for example, must be resolved via an alias or similar to a full path name to the console device. Paths also contain an optional set of 'options', which starts with a colon at the end of the path. The option area is used to specify which of two serial ports ('a' or 'b') the path refers to when a device node drives multiple ports. 'a' is assumed if the option specification is missing. This was caught by the UltraSPARC-T1 simulator. The 'output-device' property was set to 'ttya' and we didn't pick upon the fact that this is an OBP alias set to '/virtual-devices/console'. Instead we saw it as the first serial console device, instead of the hypervisor console. The infrastructure is now there to take advantage of this to resolve the console correctly even in multi-head situations in fbcon too. Thanks to Greg Onufer for the bug report. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/serial/sunhv.c')
-rw-r--r--drivers/serial/sunhv.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index d82be42ff29a..8ff900b09811 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -520,16 +520,6 @@ static struct console sunhv_console = {
520 .data = &sunhv_reg, 520 .data = &sunhv_reg,
521}; 521};
522 522
523static inline struct console *SUNHV_CONSOLE(void)
524{
525 if (con_is_present())
526 return NULL;
527
528 sunhv_console.index = 0;
529
530 return &sunhv_console;
531}
532
533static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match) 523static int __devinit hv_probe(struct of_device *op, const struct of_device_id *match)
534{ 524{
535 struct uart_port *port; 525 struct uart_port *port;
@@ -582,7 +572,8 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
582 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64; 572 sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;
583 sunserial_current_minor += 1; 573 sunserial_current_minor += 1;
584 574
585 sunhv_reg.cons = SUNHV_CONSOLE(); 575 sunserial_console_match(&sunhv_console, op->node,
576 &sunhv_reg, port->line);
586 577
587 err = uart_add_one_port(&sunhv_reg, port); 578 err = uart_add_one_port(&sunhv_reg, port);
588 if (err) 579 if (err)