[PATCH] serial: rda-uart: make it explicitly non-modular

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Kconfig currently controlling compilation of this code is:

drivers/tty/serial/Kconfig:config SERIAL_RDA
drivers/tty/serial/Kconfig:     bool "RDA Micro serial port support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

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

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Jiri Slaby <jslaby@xxxxxxxx>
Cc: linux-serial@xxxxxxxxxxxxxxx
Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>

diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c
index 284623eefaeb..ce3d9c6fcb91 100644
--- a/drivers/tty/serial/rda-uart.c
+++ b/drivers/tty/serial/rda-uart.c
@@ -4,14 +4,15 @@
  *
  * Copyright RDA Microelectronics Company Limited
  * Copyright (c) 2017 Andreas Färber
- * Copyright (c) 2018 Manivannan Sadhasivam
+ * Copyright (c) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
+ * License: GPL
  */
 
 #include <linux/clk.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/serial.h>
@@ -712,7 +713,6 @@ static const struct of_device_id rda_uart_dt_matches[] = {
 	{ .compatible = "rda,8810pl-uart" },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, rda_uart_dt_matches);
 
 static int rda_uart_probe(struct platform_device *pdev)
 {
@@ -783,21 +783,11 @@ static int rda_uart_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rda_uart_remove(struct platform_device *pdev)
-{
-	struct rda_uart_port *rda_port = platform_get_drvdata(pdev);
-
-	uart_remove_one_port(&rda_uart_driver, &rda_port->port);
-	rda_uart_ports[pdev->id] = NULL;
-
-	return 0;
-}
-
 static struct platform_driver rda_uart_platform_driver = {
 	.probe = rda_uart_probe,
-	.remove = rda_uart_remove,
 	.driver = {
 		.name = "rda-uart",
+		.suppress_bind_attrs = true,
 		.of_match_table = rda_uart_dt_matches,
 	},
 };
@@ -816,16 +806,4 @@ static int __init rda_uart_init(void)
 
 	return ret;
 }
-
-static void __init rda_uart_exit(void)
-{
-	platform_driver_unregister(&rda_uart_platform_driver);
-	uart_unregister_driver(&rda_uart_driver);
-}
-
-module_init(rda_uart_init);
-module_exit(rda_uart_exit);
-
-MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>");
-MODULE_DESCRIPTION("RDA8810PL serial device driver");
-MODULE_LICENSE("GPL");
+device_initcall(rda_uart_init);
-- 
2.7.4




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux