diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2009-01-09 06:15:00 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-01-09 06:15:09 -0500 |
commit | 68c6b3d2c6e49671f6974c9c5ea31c5f190cc8a5 (patch) | |
tree | 40a97851a9c65fc5f70071c7d915c5fc97eb4dff /drivers/char/hvc_iucv.c | |
parent | 17e19f04ac73df05854ba2e7e945d51c494a3011 (diff) |
[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/hvc_iucv.c')
-rw-r--r-- | drivers/char/hvc_iucv.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/char/hvc_iucv.c b/drivers/char/hvc_iucv.c index ce1a25f779ce..7b627368caac 100644 --- a/drivers/char/hvc_iucv.c +++ b/drivers/char/hvc_iucv.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <asm/ebcdic.h> | 15 | #include <asm/ebcdic.h> |
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <linux/init.h> | ||
17 | #include <linux/mempool.h> | 18 | #include <linux/mempool.h> |
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
19 | #include <linux/tty.h> | 20 | #include <linux/tty.h> |
@@ -898,6 +899,13 @@ static int __init hvc_iucv_init(void) | |||
898 | return -ENOMEM; | 899 | return -ENOMEM; |
899 | } | 900 | } |
900 | 901 | ||
902 | /* register the first terminal device as console | ||
903 | * (must be done before allocating hvc terminal devices) */ | ||
904 | rc = hvc_instantiate(HVC_IUCV_MAGIC, 0, &hvc_iucv_ops); | ||
905 | if (rc) | ||
906 | pr_warning("Registering HVC terminal device as " | ||
907 | "Linux console failed\n"); | ||
908 | |||
901 | /* allocate hvc_iucv_private structs */ | 909 | /* allocate hvc_iucv_private structs */ |
902 | for (i = 0; i < hvc_iucv_devices; i++) { | 910 | for (i = 0; i < hvc_iucv_devices; i++) { |
903 | rc = hvc_iucv_alloc(i); | 911 | rc = hvc_iucv_alloc(i); |
@@ -933,16 +941,6 @@ out_error_hvc: | |||
933 | } | 941 | } |
934 | 942 | ||
935 | /** | 943 | /** |
936 | * hvc_iucv_console_init() - Early console initialization | ||
937 | */ | ||
938 | static int __init hvc_iucv_console_init(void) | ||
939 | { | ||
940 | if (!MACHINE_IS_VM || !hvc_iucv_devices) | ||
941 | return -ENODEV; | ||
942 | return hvc_instantiate(HVC_IUCV_MAGIC, 0, &hvc_iucv_ops); | ||
943 | } | ||
944 | |||
945 | /** | ||
946 | * hvc_iucv_config() - Parsing of hvc_iucv= kernel command line parameter | 944 | * hvc_iucv_config() - Parsing of hvc_iucv= kernel command line parameter |
947 | * @val: Parameter value (numeric) | 945 | * @val: Parameter value (numeric) |
948 | */ | 946 | */ |
@@ -952,10 +950,5 @@ static int __init hvc_iucv_config(char *val) | |||
952 | } | 950 | } |
953 | 951 | ||
954 | 952 | ||
955 | module_init(hvc_iucv_init); | 953 | device_initcall(hvc_iucv_init); |
956 | console_initcall(hvc_iucv_console_init); | ||
957 | __setup("hvc_iucv=", hvc_iucv_config); | 954 | __setup("hvc_iucv=", hvc_iucv_config); |
958 | |||
959 | MODULE_LICENSE("GPL"); | ||
960 | MODULE_DESCRIPTION("HVC back-end for z/VM IUCV."); | ||
961 | MODULE_AUTHOR("Hendrik Brueckner <brueckner@linux.vnet.ibm.com>"); | ||