aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc64/kernel/setup.c1
-rw-r--r--drivers/serial/sunhv.c25
2 files changed, 11 insertions, 15 deletions
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 4f253a0755b0..06807cf95ee1 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -410,6 +410,7 @@ static int __init set_preferred_console(void)
410 * value anyways... 410 * value anyways...
411 */ 411 */
412 serial_console = 4; 412 serial_console = 4;
413 return add_preferred_console("ttyHV", 0, NULL);
413 } else { 414 } else {
414 prom_printf("Inconsistent console: " 415 prom_printf("Inconsistent console: "
415 "input %d, output %d\n", 416 "input %d, output %d\n",
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index d3a9dd739da3..71c70d7a998c 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -360,7 +360,7 @@ static struct uart_port *sunhv_port;
360static inline void sunhv_console_putchar(struct uart_port *port, char c) 360static inline void sunhv_console_putchar(struct uart_port *port, char c)
361{ 361{
362 unsigned long flags; 362 unsigned long flags;
363 int limit = 10000; 363 int limit = 1000000;
364 364
365 spin_lock_irqsave(&port->lock, flags); 365 spin_lock_irqsave(&port->lock, flags);
366 366
@@ -368,6 +368,7 @@ static inline void sunhv_console_putchar(struct uart_port *port, char c)
368 long status = hypervisor_con_putchar(c); 368 long status = hypervisor_con_putchar(c);
369 if (status == HV_EOK) 369 if (status == HV_EOK)
370 break; 370 break;
371 udelay(2);
371 } 372 }
372 373
373 spin_unlock_irqrestore(&port->lock, flags); 374 spin_unlock_irqrestore(&port->lock, flags);
@@ -385,28 +386,23 @@ static void sunhv_console_write(struct console *con, const char *s, unsigned n)
385 } 386 }
386} 387}
387 388
388static int sunhv_console_setup(struct console *con, char *options)
389{
390 return 0;
391}
392
393static struct console sunhv_console = { 389static struct console sunhv_console = {
394 .name = "ttyS", 390 .name = "ttyHV",
395 .write = sunhv_console_write, 391 .write = sunhv_console_write,
396 .device = uart_console_device, 392 .device = uart_console_device,
397 .setup = sunhv_console_setup,
398 .flags = CON_PRINTBUFFER, 393 .flags = CON_PRINTBUFFER,
399 .index = -1, 394 .index = -1,
400 .data = &sunhv_reg, 395 .data = &sunhv_reg,
401}; 396};
402 397
403static void __init sunhv_console_init(void) 398static inline struct console *SUNHV_CONSOLE(void)
404{ 399{
405 if (con_is_present()) 400 if (con_is_present())
406 return; 401 return NULL;
407 402
408 sunhv_console.index = 0; 403 sunhv_console.index = 0;
409 register_console(&sunhv_console); 404
405 return &sunhv_console;
410} 406}
411 407
412static int __init hv_console_compatible(char *buf, int len) 408static int __init hv_console_compatible(char *buf, int len)
@@ -496,7 +492,6 @@ static int __init sunhv_init(void)
496 492
497 sunhv_reg.minor = sunserial_current_minor; 493 sunhv_reg.minor = sunserial_current_minor;
498 sunhv_reg.nr = 1; 494 sunhv_reg.nr = 1;
499 sunhv_reg.cons = &sunhv_console;
500 495
501 ret = uart_register_driver(&sunhv_reg); 496 ret = uart_register_driver(&sunhv_reg);
502 if (ret < 0) { 497 if (ret < 0) {
@@ -506,11 +501,11 @@ static int __init sunhv_init(void)
506 return ret; 501 return ret;
507 } 502 }
508 503
509 sunhv_port = port;
510
511 sunserial_current_minor += 1; 504 sunserial_current_minor += 1;
512 505
513 sunhv_console_init(); 506 sunhv_reg.cons = SUNHV_CONSOLE();
507
508 sunhv_port = port;
514 509
515 uart_add_one_port(&sunhv_reg, port); 510 uart_add_one_port(&sunhv_reg, port);
516 511