diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2008-02-06 12:23:41 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2008-02-06 12:23:41 -0500 |
commit | 3de66a175d2014246a2e990412e5750922e5c7d8 (patch) | |
tree | fb30686420b85296fc0e769ebee2feb60281b66e | |
parent | 0e349b0e2d90eb1bb76d16c48d0127feebfeeb89 (diff) |
[POWERPC] Eliminate broken OF console initialization.
Probing of the console at console_initcall time is broken. It tries to
call memory allocation routines which aren't initialized yet.
Problem solved by removing the early probe entirely. The console init
is called again anyway after the uartlite device is initialized and the
memory allocation routines can be called safely.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-rw-r--r-- | drivers/serial/uartlite.c | 32 |
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) | ||
393 | static 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 */ | ||
415 | static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ } | ||
416 | #endif /* CONFIG_OF */ | ||
417 | |||
418 | static int __init ulite_console_setup(struct console *co, char *options) | 392 | static 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; |