diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2014-01-15 16:35:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 11:40:54 -0500 |
commit | 4fedd0bf479558e50924c6d88f9197336742d20f (patch) | |
tree | 3b627ff186aa497c1401e240cc92c2e631553209 | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
drivers/tty/hvc: don't use module_init in non-modular hyp. console code
The HVC_OPAL/RTAS/UDBG/XEN options are all bool, and hence their support
is either present or absent. It will never be modular, so using
module_init as an alias for __initcall is rather misleading.
Fix this up now, so that we can relocate module_init from
init.h into module.h in the future. If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.
Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups. As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- it will remain at level 6 in initcall ordering.
Also the __exitcall functions have been outright deleted since
they are only ever of interest to UML, and UML will never be
using any of this code.
Cc: Richard Weinberger <richard@nod.at>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/hvc/hvc_opal.c | 8 | ||||
-rw-r--r-- | drivers/tty/hvc/hvc_rtas.c | 12 | ||||
-rw-r--r-- | drivers/tty/hvc/hvc_udbg.c | 9 | ||||
-rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 17 |
4 files changed, 4 insertions, 42 deletions
diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index 6496872e2e47..b01659bd4f7c 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c | |||
@@ -255,13 +255,7 @@ static int __init hvc_opal_init(void) | |||
255 | /* Register as a vio device to receive callbacks */ | 255 | /* Register as a vio device to receive callbacks */ |
256 | return platform_driver_register(&hvc_opal_driver); | 256 | return platform_driver_register(&hvc_opal_driver); |
257 | } | 257 | } |
258 | module_init(hvc_opal_init); | 258 | device_initcall(hvc_opal_init); |
259 | |||
260 | static void __exit hvc_opal_exit(void) | ||
261 | { | ||
262 | platform_driver_unregister(&hvc_opal_driver); | ||
263 | } | ||
264 | module_exit(hvc_opal_exit); | ||
265 | 259 | ||
266 | static void udbg_opal_putc(char c) | 260 | static void udbg_opal_putc(char c) |
267 | { | 261 | { |
diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c index 0069bb86ba49..08c87920b74a 100644 --- a/drivers/tty/hvc/hvc_rtas.c +++ b/drivers/tty/hvc/hvc_rtas.c | |||
@@ -102,17 +102,7 @@ static int __init hvc_rtas_init(void) | |||
102 | 102 | ||
103 | return 0; | 103 | return 0; |
104 | } | 104 | } |
105 | module_init(hvc_rtas_init); | 105 | device_initcall(hvc_rtas_init); |
106 | |||
107 | /* This will tear down the tty portion of the driver */ | ||
108 | static void __exit hvc_rtas_exit(void) | ||
109 | { | ||
110 | /* Really the fun isn't over until the worker thread breaks down and | ||
111 | * the tty cleans up */ | ||
112 | if (hvc_rtas_dev) | ||
113 | hvc_remove(hvc_rtas_dev); | ||
114 | } | ||
115 | module_exit(hvc_rtas_exit); | ||
116 | 106 | ||
117 | /* This will happen prior to module init. There is no tty at this time? */ | 107 | /* This will happen prior to module init. There is no tty at this time? */ |
118 | static int __init hvc_rtas_console_init(void) | 108 | static int __init hvc_rtas_console_init(void) |
diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c index 72228276fe31..9cf573d06a29 100644 --- a/drivers/tty/hvc/hvc_udbg.c +++ b/drivers/tty/hvc/hvc_udbg.c | |||
@@ -80,14 +80,7 @@ static int __init hvc_udbg_init(void) | |||
80 | 80 | ||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | module_init(hvc_udbg_init); | 83 | device_initcall(hvc_udbg_init); |
84 | |||
85 | static void __exit hvc_udbg_exit(void) | ||
86 | { | ||
87 | if (hvc_udbg_dev) | ||
88 | hvc_remove(hvc_udbg_dev); | ||
89 | } | ||
90 | module_exit(hvc_udbg_exit); | ||
91 | 84 | ||
92 | static int __init hvc_udbg_console_init(void) | 85 | static int __init hvc_udbg_console_init(void) |
93 | { | 86 | { |
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 636c9baad7a5..2dc2831840ca 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c | |||
@@ -561,18 +561,7 @@ static int __init xen_hvc_init(void) | |||
561 | #endif | 561 | #endif |
562 | return r; | 562 | return r; |
563 | } | 563 | } |
564 | 564 | device_initcall(xen_hvc_init); | |
565 | static void __exit xen_hvc_fini(void) | ||
566 | { | ||
567 | struct xencons_info *entry, *next; | ||
568 | |||
569 | if (list_empty(&xenconsoles)) | ||
570 | return; | ||
571 | |||
572 | list_for_each_entry_safe(entry, next, &xenconsoles, list) { | ||
573 | xen_console_remove(entry); | ||
574 | } | ||
575 | } | ||
576 | 565 | ||
577 | static int xen_cons_init(void) | 566 | static int xen_cons_init(void) |
578 | { | 567 | { |
@@ -598,10 +587,6 @@ static int xen_cons_init(void) | |||
598 | hvc_instantiate(HVC_COOKIE, 0, ops); | 587 | hvc_instantiate(HVC_COOKIE, 0, ops); |
599 | return 0; | 588 | return 0; |
600 | } | 589 | } |
601 | |||
602 | |||
603 | module_init(xen_hvc_init); | ||
604 | module_exit(xen_hvc_fini); | ||
605 | console_initcall(xen_cons_init); | 590 | console_initcall(xen_cons_init); |
606 | 591 | ||
607 | #ifdef CONFIG_EARLY_PRINTK | 592 | #ifdef CONFIG_EARLY_PRINTK |