Commit 4fedd0bf authored by Paul Gortmaker's avatar Paul Gortmaker Committed by Greg Kroah-Hartman

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: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 38dbfb59
...@@ -255,13 +255,7 @@ static int __init hvc_opal_init(void) ...@@ -255,13 +255,7 @@ static int __init hvc_opal_init(void)
/* Register as a vio device to receive callbacks */ /* Register as a vio device to receive callbacks */
return platform_driver_register(&hvc_opal_driver); return platform_driver_register(&hvc_opal_driver);
} }
module_init(hvc_opal_init); device_initcall(hvc_opal_init);
static void __exit hvc_opal_exit(void)
{
platform_driver_unregister(&hvc_opal_driver);
}
module_exit(hvc_opal_exit);
static void udbg_opal_putc(char c) static void udbg_opal_putc(char c)
{ {
......
...@@ -102,17 +102,7 @@ static int __init hvc_rtas_init(void) ...@@ -102,17 +102,7 @@ static int __init hvc_rtas_init(void)
return 0; return 0;
} }
module_init(hvc_rtas_init); device_initcall(hvc_rtas_init);
/* This will tear down the tty portion of the driver */
static void __exit hvc_rtas_exit(void)
{
/* Really the fun isn't over until the worker thread breaks down and
* the tty cleans up */
if (hvc_rtas_dev)
hvc_remove(hvc_rtas_dev);
}
module_exit(hvc_rtas_exit);
/* This will happen prior to module init. There is no tty at this time? */ /* This will happen prior to module init. There is no tty at this time? */
static int __init hvc_rtas_console_init(void) static int __init hvc_rtas_console_init(void)
......
...@@ -80,14 +80,7 @@ static int __init hvc_udbg_init(void) ...@@ -80,14 +80,7 @@ static int __init hvc_udbg_init(void)
return 0; return 0;
} }
module_init(hvc_udbg_init); device_initcall(hvc_udbg_init);
static void __exit hvc_udbg_exit(void)
{
if (hvc_udbg_dev)
hvc_remove(hvc_udbg_dev);
}
module_exit(hvc_udbg_exit);
static int __init hvc_udbg_console_init(void) static int __init hvc_udbg_console_init(void)
{ {
......
...@@ -561,18 +561,7 @@ static int __init xen_hvc_init(void) ...@@ -561,18 +561,7 @@ static int __init xen_hvc_init(void)
#endif #endif
return r; return r;
} }
device_initcall(xen_hvc_init);
static void __exit xen_hvc_fini(void)
{
struct xencons_info *entry, *next;
if (list_empty(&xenconsoles))
return;
list_for_each_entry_safe(entry, next, &xenconsoles, list) {
xen_console_remove(entry);
}
}
static int xen_cons_init(void) static int xen_cons_init(void)
{ {
...@@ -598,10 +587,6 @@ static int xen_cons_init(void) ...@@ -598,10 +587,6 @@ static int xen_cons_init(void)
hvc_instantiate(HVC_COOKIE, 0, ops); hvc_instantiate(HVC_COOKIE, 0, ops);
return 0; return 0;
} }
module_init(xen_hvc_init);
module_exit(xen_hvc_fini);
console_initcall(xen_cons_init); console_initcall(xen_cons_init);
#ifdef CONFIG_EARLY_PRINTK #ifdef CONFIG_EARLY_PRINTK
......
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