Commit c4de0c1a authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by Martin Schwidefsky

[S390] kvm: use console_initcall() to initialize s390 virtio console

Use a console_initcall() to initialize the s390 virtio console and
clean up s390 console initialization in setup.c.
Signed-off-by: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 68d36bdb
...@@ -54,14 +54,4 @@ struct kvm_vqconfig { ...@@ -54,14 +54,4 @@ struct kvm_vqconfig {
* This is pagesize for historical reasons. */ * This is pagesize for historical reasons. */
#define KVM_S390_VIRTIO_RING_ALIGN 4096 #define KVM_S390_VIRTIO_RING_ALIGN 4096
#ifdef __KERNEL__
/* early virtio console setup */
#ifdef CONFIG_S390_GUEST
extern void s390_virtio_console_init(void);
#else
static inline void s390_virtio_console_init(void)
{
}
#endif /* CONFIG_VIRTIO_CONSOLE */
#endif /* __KERNEL__ */
#endif #endif
...@@ -156,15 +156,11 @@ __setup("condev=", condev_setup); ...@@ -156,15 +156,11 @@ __setup("condev=", condev_setup);
static void __init set_preferred_console(void) static void __init set_preferred_console(void)
{ {
if (MACHINE_IS_KVM) { if (MACHINE_IS_KVM)
add_preferred_console("hvc", 0, NULL); add_preferred_console("hvc", 0, NULL);
s390_virtio_console_init(); else if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP)
return;
}
if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP)
add_preferred_console("ttyS", 0, NULL); add_preferred_console("ttyS", 0, NULL);
if (CONSOLE_IS_3270) else if (CONSOLE_IS_3270)
add_preferred_console("tty3270", 0, NULL); add_preferred_console("tty3270", 0, NULL);
} }
......
...@@ -403,10 +403,14 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count) ...@@ -403,10 +403,14 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count)
return len; return len;
} }
void __init s390_virtio_console_init(void) static int __init s390_virtio_console_init(void)
{ {
virtio_cons_early_init(early_put_chars); if (!MACHINE_IS_KVM)
return -ENODEV;
return virtio_cons_early_init(early_put_chars);
} }
console_initcall(s390_virtio_console_init);
/* /*
* We do this after core stuff, but before the drivers. * We do this after core stuff, but before the drivers.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment