[PATCH 4/4] drivers/tty: make serial/sunhv.c driver explicitly non-modular

2015-07-21 Thread Paul Gortmaker
The Kconfig for this driver is currently:

config SERIAL_SUNHV
bool "Sun4v Hypervisor Console support"

...meaning that it currently is not being built as a module by
anyone.  Lets remove the modular and unused code here, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We don't swap module.h for init.h since this file has init.h already.

We leave some tags like MODULE_LICENSE for documentation purposes, and
for the "git blame" value.  Also note that MODULE_DEVICE_TABLE is a
no-op for non-modular code, so we remove that too.

Cc: "David S. Miller" 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: sparcli...@vger.kernel.org
Cc: linux-ser...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 drivers/tty/serial/sunhv.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 534754440fa8..064031870ba0 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -3,7 +3,6 @@
  * Copyright (C) 2006, 2007 David S. Miller (da...@davemloft.net)
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -621,7 +620,6 @@ static const struct of_device_id hv_match[] = {
},
{},
 };
-MODULE_DEVICE_TABLE(of, hv_match);
 
 static struct platform_driver hv_driver = {
.driver = {
@@ -639,16 +637,11 @@ static int __init sunhv_init(void)
 
return platform_driver_register(_driver);
 }
+device_initcall(sunhv_init);
 
-static void __exit sunhv_exit(void)
-{
-   platform_driver_unregister(_driver);
-}
-
-module_init(sunhv_init);
-module_exit(sunhv_exit);
-
+#if 0 /* ...def MODULE ; never supported as such */
 MODULE_AUTHOR("David S. Miller");
 MODULE_DESCRIPTION("SUN4V Hypervisor console driver");
 MODULE_VERSION("2.0");
 MODULE_LICENSE("GPL");
+#endif
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] drivers/tty: make serial/sunhv.c driver explicitly non-modular

2015-07-21 Thread Paul Gortmaker
The Kconfig for this driver is currently:

config SERIAL_SUNHV
bool Sun4v Hypervisor Console support

...meaning that it currently is not being built as a module by
anyone.  Lets remove the modular and unused code here, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We don't swap module.h for init.h since this file has init.h already.

We leave some tags like MODULE_LICENSE for documentation purposes, and
for the git blame value.  Also note that MODULE_DEVICE_TABLE is a
no-op for non-modular code, so we remove that too.

Cc: David S. Miller da...@davemloft.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Jiri Slaby jsl...@suse.com
Cc: sparcli...@vger.kernel.org
Cc: linux-ser...@vger.kernel.org
Signed-off-by: Paul Gortmaker paul.gortma...@windriver.com
---
 drivers/tty/serial/sunhv.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 534754440fa8..064031870ba0 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -3,7 +3,6 @@
  * Copyright (C) 2006, 2007 David S. Miller (da...@davemloft.net)
  */
 
-#include linux/module.h
 #include linux/kernel.h
 #include linux/errno.h
 #include linux/tty.h
@@ -621,7 +620,6 @@ static const struct of_device_id hv_match[] = {
},
{},
 };
-MODULE_DEVICE_TABLE(of, hv_match);
 
 static struct platform_driver hv_driver = {
.driver = {
@@ -639,16 +637,11 @@ static int __init sunhv_init(void)
 
return platform_driver_register(hv_driver);
 }
+device_initcall(sunhv_init);
 
-static void __exit sunhv_exit(void)
-{
-   platform_driver_unregister(hv_driver);
-}
-
-module_init(sunhv_init);
-module_exit(sunhv_exit);
-
+#if 0 /* ...def MODULE ; never supported as such */
 MODULE_AUTHOR(David S. Miller);
 MODULE_DESCRIPTION(SUN4V Hypervisor console driver);
 MODULE_VERSION(2.0);
 MODULE_LICENSE(GPL);
+#endif
-- 
2.2.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/