aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/uartlite.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index b22023f1ec6b..1a7bccebd503 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -389,32 +389,6 @@ static void ulite_console_write(struct console *co, const char *s,
389 spin_unlock_irqrestore(&port->lock, flags); 389 spin_unlock_irqrestore(&port->lock, flags);
390} 390}
391 391
392#if defined(CONFIG_OF)
393static inline void __init ulite_console_of_find_device(int id)
394{
395 struct device_node *np;
396 struct resource res;
397 const unsigned int *of_id;
398 int rc;
399
400 for_each_matching_node(np, ulite_of_match) {
401 of_id = of_get_property(np, "port-number", NULL);
402 if ((!of_id) || (*of_id != id))
403 continue;
404
405 rc = of_address_to_resource(np, 0, &res);
406 if (rc)
407 continue;
408
409 ulite_ports[id].mapbase = res.start;
410 of_node_put(np);
411 return;
412 }
413}
414#else /* CONFIG_OF */
415static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
416#endif /* CONFIG_OF */
417
418static int __init ulite_console_setup(struct console *co, char *options) 392static int __init ulite_console_setup(struct console *co, char *options)
419{ 393{
420 struct uart_port *port; 394 struct uart_port *port;
@@ -428,11 +402,7 @@ static int __init ulite_console_setup(struct console *co, char *options)
428 402
429 port = &ulite_ports[co->index]; 403 port = &ulite_ports[co->index];
430 404
431 /* Check if it is an OF device */ 405 /* Has the device been initialized yet? */
432 if (!port->mapbase)
433 ulite_console_of_find_device(co->index);
434
435 /* Do we have a device now? */
436 if (!port->mapbase) { 406 if (!port->mapbase) {
437 pr_debug("console on ttyUL%i not present\n", co->index); 407 pr_debug("console on ttyUL%i not present\n", co->index);
438 return -ENODEV; 408 return -ENODEV;