diff options
Diffstat (limited to 'drivers/serial/sunsu.c')
-rw-r--r-- | drivers/serial/sunsu.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 26d720baf88c..79b13685bdfa 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -1371,28 +1371,12 @@ static struct console sunsu_console = { | |||
1371 | * Register console. | 1371 | * Register console. |
1372 | */ | 1372 | */ |
1373 | 1373 | ||
1374 | static inline struct console *SUNSU_CONSOLE(int num_uart) | 1374 | static inline struct console *SUNSU_CONSOLE(void) |
1375 | { | 1375 | { |
1376 | int i; | ||
1377 | |||
1378 | if (con_is_present()) | ||
1379 | return NULL; | ||
1380 | |||
1381 | for (i = 0; i < num_uart; i++) { | ||
1382 | int this_minor = sunsu_reg.minor + i; | ||
1383 | |||
1384 | if ((this_minor - 64) == (serial_console - 1)) | ||
1385 | break; | ||
1386 | } | ||
1387 | if (i == num_uart) | ||
1388 | return NULL; | ||
1389 | |||
1390 | sunsu_console.index = i; | ||
1391 | |||
1392 | return &sunsu_console; | 1376 | return &sunsu_console; |
1393 | } | 1377 | } |
1394 | #else | 1378 | #else |
1395 | #define SUNSU_CONSOLE(num_uart) (NULL) | 1379 | #define SUNSU_CONSOLE() (NULL) |
1396 | #define sunsu_serial_console_init() do { } while (0) | 1380 | #define sunsu_serial_console_init() do { } while (0) |
1397 | #endif | 1381 | #endif |
1398 | 1382 | ||
@@ -1482,6 +1466,8 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m | |||
1482 | 1466 | ||
1483 | up->port.ops = &sunsu_pops; | 1467 | up->port.ops = &sunsu_pops; |
1484 | 1468 | ||
1469 | sunserial_console_match(SUNSU_CONSOLE(), dp, | ||
1470 | &sunsu_reg, up->port.line); | ||
1485 | err = uart_add_one_port(&sunsu_reg, &up->port); | 1471 | err = uart_add_one_port(&sunsu_reg, &up->port); |
1486 | if (err) | 1472 | if (err) |
1487 | goto out_unmap; | 1473 | goto out_unmap; |
@@ -1572,7 +1558,6 @@ static int __init sunsu_init(void) | |||
1572 | return err; | 1558 | return err; |
1573 | sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; | 1559 | sunsu_reg.tty_driver->name_base = sunsu_reg.minor - 64; |
1574 | sunserial_current_minor += num_uart; | 1560 | sunserial_current_minor += num_uart; |
1575 | sunsu_reg.cons = SUNSU_CONSOLE(num_uart); | ||
1576 | } | 1561 | } |
1577 | 1562 | ||
1578 | err = of_register_driver(&su_driver, &of_bus_type); | 1563 | err = of_register_driver(&su_driver, &of_bus_type); |