summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2009-01-09 11:15:00 (GMT)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-01-09 11:15:09 (GMT)
commit68c6b3d2c6e49671f6974c9c5ea31c5f190cc8a5 (patch)
tree40a97851a9c65fc5f70071c7d915c5fc97eb4dff /drivers/char
parent17e19f04ac73df05854ba2e7e945d51c494a3011 (diff)
downloadlinux-68c6b3d2c6e49671f6974c9c5ea31c5f190cc8a5.tar.xz
[S390] hvc_iucv: Refactor console and device initialization
The console_initcall() order might pick up the hvc_iucv device as preferred console even if it is not yet initialized. Move HVC console instantiation to hvc_iucv_init() and cleanup device driver initialization. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hvc_iucv.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/char/hvc_iucv.c b/drivers/char/hvc_iucv.c
index ce1a25f..7b62736 100644
--- a/drivers/char/hvc_iucv.c
+++ b/drivers/char/hvc_iucv.c
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <asm/ebcdic.h>
#include <linux/delay.h>
+#include <linux/init.h>
#include <linux/mempool.h>
#include <linux/module.h>
#include <linux/tty.h>
@@ -898,6 +899,13 @@ static int __init hvc_iucv_init(void)
return -ENOMEM;
}
+ /* register the first terminal device as console
+ * (must be done before allocating hvc terminal devices) */
+ rc = hvc_instantiate(HVC_IUCV_MAGIC, 0, &hvc_iucv_ops);
+ if (rc)
+ pr_warning("Registering HVC terminal device as "
+ "Linux console failed\n");
+
/* allocate hvc_iucv_private structs */
for (i = 0; i < hvc_iucv_devices; i++) {
rc = hvc_iucv_alloc(i);
@@ -933,16 +941,6 @@ out_error_hvc:
}
/**
- * hvc_iucv_console_init() - Early console initialization
- */
-static int __init hvc_iucv_console_init(void)
-{
- if (!MACHINE_IS_VM || !hvc_iucv_devices)
- return -ENODEV;
- return hvc_instantiate(HVC_IUCV_MAGIC, 0, &hvc_iucv_ops);
-}
-
-/**
* hvc_iucv_config() - Parsing of hvc_iucv= kernel command line parameter
* @val: Parameter value (numeric)
*/
@@ -952,10 +950,5 @@ static int __init hvc_iucv_config(char *val)
}
-module_init(hvc_iucv_init);
-console_initcall(hvc_iucv_console_init);
+device_initcall(hvc_iucv_init);
__setup("hvc_iucv=", hvc_iucv_config);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("HVC back-end for z/VM IUCV.");
-MODULE_AUTHOR("Hendrik Brueckner <brueckner@linux.vnet.ibm.com>");