linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/12] serial: clps711x: Add platform_driver interface to clps711x driver
@ 2012-10-14  7:05 Alexander Shiyan
  2012-10-14  7:05 ` [PATCH 02/12] serial: clps711x: Convert all static variables to dynamic Alexander Shiyan
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Alexander Shiyan @ 2012-10-14  7:05 UTC (permalink / raw)
  To: linux-serial
  Cc: Alan Cox, Greg Kroah-Hartman, Arnd Bergmann, Alexander Shiyan


Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/tty/serial/clps711x.c |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index d0f719f..07fef1c 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -37,10 +37,13 @@
 #include <linux/serial_core.h>
 #include <linux/serial.h>
 #include <linux/io.h>
+#include <linux/platform_device.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
 
+#define UART_CLPS711X_NAME	"uart-clps711x"
+
 #define UART_NR		2
 
 #define SERIAL_CLPS711X_MAJOR	204
@@ -543,7 +546,7 @@ static struct uart_driver clps711x_reg = {
 	.cons			= CLPS711X_CONSOLE,
 };
 
-static int __init clps711xuart_init(void)
+static int __devinit uart_clps711x_probe(struct platform_device *pdev)
 {
 	int ret, i;
 
@@ -559,7 +562,7 @@ static int __init clps711xuart_init(void)
 	return 0;
 }
 
-static void __exit clps711xuart_exit(void)
+static int __devexit uart_clps711x_remove(struct platform_device *pdev)
 {
 	int i;
 
@@ -567,12 +570,36 @@ static void __exit clps711xuart_exit(void)
 		uart_remove_one_port(&clps711x_reg, &clps711x_ports[i]);
 
 	uart_unregister_driver(&clps711x_reg);
+
+	return 0;
 }
 
-module_init(clps711xuart_init);
-module_exit(clps711xuart_exit);
+static struct platform_driver clps711x_uart_driver = {
+	.driver = {
+		.name	= UART_CLPS711X_NAME,
+		.owner	= THIS_MODULE,
+	},
+	.probe	= uart_clps711x_probe,
+	.remove	= __devexit_p(uart_clps711x_remove),
+};
+module_platform_driver(clps711x_uart_driver);
+
+static struct platform_device clps711x_uart_device = {
+	.name	= UART_CLPS711X_NAME,
+};
+
+static int __init uart_clps711x_init(void)
+{
+	return platform_device_register(&clps711x_uart_device);
+}
+module_init(uart_clps711x_init);
+
+static void __exit uart_clps711x_exit(void)
+{
+	platform_device_unregister(&clps711x_uart_device);
+}
+module_exit(uart_clps711x_exit);
 
 MODULE_AUTHOR("Deep Blue Solutions Ltd");
-MODULE_DESCRIPTION("CLPS-711x generic serial driver");
+MODULE_DESCRIPTION("CLPS711X serial driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS_CHARDEV(SERIAL_CLPS711X_MAJOR, SERIAL_CLPS711X_MINOR);
-- 
1.7.8.6


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-10-14  7:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-14  7:05 [PATCH 01/12] serial: clps711x: Add platform_driver interface to clps711x driver Alexander Shiyan
2012-10-14  7:05 ` [PATCH 02/12] serial: clps711x: Convert all static variables to dynamic Alexander Shiyan
2012-10-14  7:05 ` [PATCH 03/12] serial: clps711x: Do not use "uart_port->unused" field Alexander Shiyan
2012-10-14  7:05 ` [PATCH 04/12] serial: clps711x: Using CPU clock subsystem for getting base UART speed Alexander Shiyan
2012-10-14  7:05 ` [PATCH 05/12] serial: clps711x: Improved TX FIFO handling Alexander Shiyan
2012-10-14  7:05 ` [PATCH 06/12] serial: clps711x: Return valid modem controls for port that not support it Alexander Shiyan
2012-10-14  7:05 ` [PATCH 07/12] serial: clps711x: Fix break control handling Alexander Shiyan
2012-10-14  7:05 ` [PATCH 08/12] serial: clps711x: Check for valid TTY in RX-interrupt Alexander Shiyan
2012-10-14  7:05 ` [PATCH 09/12] serial: clps711x: Using resource-managed functions Alexander Shiyan
2012-10-14  7:05 ` [PATCH 10/12] serial: clps711x: Disable "break"-state before port startup Alexander Shiyan
2012-10-14  7:05 ` [PATCH 11/12] serial: clps711x: Fix TERMIOS-flags handling Alexander Shiyan
2012-10-14  7:05 ` [PATCH 12/12] serial: clps711x: Cleanup driver Alexander Shiyan
2012-10-14  7:54 ` [PATCH 01/12] serial: clps711x: Add platform_driver interface to clps711x driver Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).