aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/clps711x.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-10-14 03:05:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-24 14:39:47 -0400
commit95113728f03cc6775ae895133c7fc420221cc8a4 (patch)
treeda238da9b0b17e20db16e3b39dd7ce7209e032c1 /drivers/tty/serial/clps711x.c
parente1a9c17969f0aa60cb00f1f777b33a07f4e84883 (diff)
serial: clps711x: Add platform_driver interface to clps711x driver
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/clps711x.c')
-rw-r--r--drivers/tty/serial/clps711x.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index d0f719fafc84..07fef1cbc115 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -37,10 +37,13 @@
37#include <linux/serial_core.h> 37#include <linux/serial_core.h>
38#include <linux/serial.h> 38#include <linux/serial.h>
39#include <linux/io.h> 39#include <linux/io.h>
40#include <linux/platform_device.h>
40 41
41#include <mach/hardware.h> 42#include <mach/hardware.h>
42#include <asm/irq.h> 43#include <asm/irq.h>
43 44
45#define UART_CLPS711X_NAME "uart-clps711x"
46
44#define UART_NR 2 47#define UART_NR 2
45 48
46#define SERIAL_CLPS711X_MAJOR 204 49#define SERIAL_CLPS711X_MAJOR 204
@@ -543,7 +546,7 @@ static struct uart_driver clps711x_reg = {
543 .cons = CLPS711X_CONSOLE, 546 .cons = CLPS711X_CONSOLE,
544}; 547};
545 548
546static int __init clps711xuart_init(void) 549static int __devinit uart_clps711x_probe(struct platform_device *pdev)
547{ 550{
548 int ret, i; 551 int ret, i;
549 552
@@ -559,7 +562,7 @@ static int __init clps711xuart_init(void)
559 return 0; 562 return 0;
560} 563}
561 564
562static void __exit clps711xuart_exit(void) 565static int __devexit uart_clps711x_remove(struct platform_device *pdev)
563{ 566{
564 int i; 567 int i;
565 568
@@ -567,12 +570,36 @@ static void __exit clps711xuart_exit(void)
567 uart_remove_one_port(&clps711x_reg, &clps711x_ports[i]); 570 uart_remove_one_port(&clps711x_reg, &clps711x_ports[i]);
568 571
569 uart_unregister_driver(&clps711x_reg); 572 uart_unregister_driver(&clps711x_reg);
573
574 return 0;
570} 575}
571 576
572module_init(clps711xuart_init); 577static struct platform_driver clps711x_uart_driver = {
573module_exit(clps711xuart_exit); 578 .driver = {
579 .name = UART_CLPS711X_NAME,
580 .owner = THIS_MODULE,
581 },
582 .probe = uart_clps711x_probe,
583 .remove = __devexit_p(uart_clps711x_remove),
584};
585module_platform_driver(clps711x_uart_driver);
586
587static struct platform_device clps711x_uart_device = {
588 .name = UART_CLPS711X_NAME,
589};
590
591static int __init uart_clps711x_init(void)
592{
593 return platform_device_register(&clps711x_uart_device);
594}
595module_init(uart_clps711x_init);
596
597static void __exit uart_clps711x_exit(void)
598{
599 platform_device_unregister(&clps711x_uart_device);
600}
601module_exit(uart_clps711x_exit);
574 602
575MODULE_AUTHOR("Deep Blue Solutions Ltd"); 603MODULE_AUTHOR("Deep Blue Solutions Ltd");
576MODULE_DESCRIPTION("CLPS-711x generic serial driver"); 604MODULE_DESCRIPTION("CLPS711X serial driver");
577MODULE_LICENSE("GPL"); 605MODULE_LICENSE("GPL");
578MODULE_ALIAS_CHARDEV(SERIAL_CLPS711X_MAJOR, SERIAL_CLPS711X_MINOR);