diff options
author | Peter Chubb <peterc@chubb.wattle.id.au> | 2007-08-21 03:51:45 (GMT) |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-09-01 09:50:39 (GMT) |
commit | 8b713c67bccef7cabb0ee915f47eb33d82636af9 (patch) | |
tree | 73a0577c8dd70825eaa41dc4527ab09432418166 /arch/ia64/hp/sim/hpsim_console.c | |
parent | 99a19cf1c0eb22bad83fff060f08330ee9e029e2 (diff) | |
download | linux-8b713c67bccef7cabb0ee915f47eb33d82636af9.tar.xz |
[IA64] Enable early console for Ski simulator
This patch cleans up the `enable early console for SKI' patch
(471e7a44848f467c9b83adc3463d019d2fa8817f), and
1. potentially allows the gensparse_defconfig to work again.
(there are other problems running a generic kernel on Ski)
2. fixes the `console registered twice' problem.
3. Cleans up the code by moving the `extern hpsim_cons' declaration to
a new asm/hpsim.h file.
Thanks to Jes for comments.
Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/hp/sim/hpsim_console.c')
-rw-r--r-- | arch/ia64/hp/sim/hpsim_console.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/ia64/hp/sim/hpsim_console.c b/arch/ia64/hp/sim/hpsim_console.c index 6e149c8..0475a545 100644 --- a/arch/ia64/hp/sim/hpsim_console.c +++ b/arch/ia64/hp/sim/hpsim_console.c @@ -21,6 +21,7 @@ #include <asm/machvec.h> #include <asm/pgtable.h> #include <asm/sal.h> +#include <asm/hpsim.h> #include "hpsim_ssc.h" @@ -28,7 +29,7 @@ static int simcons_init (struct console *, char *); static void simcons_write (struct console *, const char *, unsigned); static struct tty_driver *simcons_console_device (struct console *, int *); -struct console hpsim_cons = { +static struct console hpsim_cons = { .name = "simcons", .write = simcons_write, .device = simcons_console_device, @@ -62,3 +63,15 @@ static struct tty_driver *simcons_console_device (struct console *c, int *index) *index = c->index; return hp_simserial_driver; } + +int simcons_register(void) +{ + if (!ia64_platform_is("hpsim")) + return 1; + + if (hpsim_cons.flags & CON_ENABLED) + return 1; + + register_console(&hpsim_cons); + return 0; +} |