From c3036f4044a955925dbb199cf6a31ac5d68d3e1f Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 14 Oct 2012 11:05:23 +0400 Subject: [PATCH] --- yaml --- r: 338367 b: refs/heads/master c: 95113728f03cc6775ae895133c7fc420221cc8a4 h: refs/heads/master i: 338365: a07a812b515406898fb891bb1e579e6fcfc881f3 338363: 7a4e559dcb2167b2b6adbc80774d91e9253a9d9a 338359: 2829e0b27b7bc9a35cf3a70f0c3c84f9ccb8ac92 338351: f0a7c0fb1ace27a9de84bc7b4a8048ddbe1664d8 338335: 4ba2bf5f5e23ef3cbf12670374adeb81151881da 338303: 0b7b6347e1980ea0477a76af6b3abe0276901a72 v: v3 --- [refs] | 2 +- trunk/drivers/tty/serial/clps711x.c | 39 ++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 915d6e8a0003..3132f7962a00 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1a9c17969f0aa60cb00f1f777b33a07f4e84883 +refs/heads/master: 95113728f03cc6775ae895133c7fc420221cc8a4 diff --git a/trunk/drivers/tty/serial/clps711x.c b/trunk/drivers/tty/serial/clps711x.c index d0f719fafc84..07fef1cbc115 100644 --- a/trunk/drivers/tty/serial/clps711x.c +++ b/trunk/drivers/tty/serial/clps711x.c @@ -37,10 +37,13 @@ #include #include #include +#include #include #include +#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);