diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-28 06:22:15 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-30 06:11:46 -0500 |
commit | c8381c15b14b7c2d212c182d3b9b3fa7217994da (patch) | |
tree | 48ac78d7b1b965571a147ae44eabf2c95bb0b663 | |
parent | 782ee87702fbd0a175da64a8e71e029b19ef97bf (diff) |
TTY: serial: convert drivers/tty/serial/* to use module_platform_driver()
This patch converts the drivers in drivers/tty/serial/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/tty/serial/8250_dw.c | 12 | ||||
-rw-r--r-- | drivers/tty/serial/sc26xx.c | 14 | ||||
-rw-r--r-- | drivers/tty/serial/timbuart.c | 15 | ||||
-rw-r--r-- | drivers/tty/serial/vr41xx_siu.c | 13 |
4 files changed, 4 insertions, 50 deletions
diff --git a/drivers/tty/serial/8250_dw.c b/drivers/tty/serial/8250_dw.c index bf1fba640c2d..f574eef3075f 100644 --- a/drivers/tty/serial/8250_dw.c +++ b/drivers/tty/serial/8250_dw.c | |||
@@ -177,17 +177,7 @@ static struct platform_driver dw8250_platform_driver = { | |||
177 | .remove = __devexit_p(dw8250_remove), | 177 | .remove = __devexit_p(dw8250_remove), |
178 | }; | 178 | }; |
179 | 179 | ||
180 | static int __init dw8250_init(void) | 180 | module_platform_driver(dw8250_platform_driver); |
181 | { | ||
182 | return platform_driver_register(&dw8250_platform_driver); | ||
183 | } | ||
184 | module_init(dw8250_init); | ||
185 | |||
186 | static void __exit dw8250_exit(void) | ||
187 | { | ||
188 | platform_driver_unregister(&dw8250_platform_driver); | ||
189 | } | ||
190 | module_exit(dw8250_exit); | ||
191 | 181 | ||
192 | MODULE_AUTHOR("Jamie Iles"); | 182 | MODULE_AUTHOR("Jamie Iles"); |
193 | MODULE_LICENSE("GPL"); | 183 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/tty/serial/sc26xx.c b/drivers/tty/serial/sc26xx.c index 75038ad2b242..e0b4b0a30a5a 100644 --- a/drivers/tty/serial/sc26xx.c +++ b/drivers/tty/serial/sc26xx.c | |||
@@ -736,19 +736,7 @@ static struct platform_driver sc26xx_driver = { | |||
736 | }, | 736 | }, |
737 | }; | 737 | }; |
738 | 738 | ||
739 | static int __init sc26xx_init(void) | 739 | module_platform_driver(sc26xx_driver); |
740 | { | ||
741 | return platform_driver_register(&sc26xx_driver); | ||
742 | } | ||
743 | |||
744 | static void __exit sc26xx_exit(void) | ||
745 | { | ||
746 | platform_driver_unregister(&sc26xx_driver); | ||
747 | } | ||
748 | |||
749 | module_init(sc26xx_init); | ||
750 | module_exit(sc26xx_exit); | ||
751 | |||
752 | 740 | ||
753 | MODULE_AUTHOR("Thomas Bogendörfer"); | 741 | MODULE_AUTHOR("Thomas Bogendörfer"); |
754 | MODULE_DESCRIPTION("SC681/SC2692 serial driver"); | 742 | MODULE_DESCRIPTION("SC681/SC2692 serial driver"); |
diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index e76c8b747fb8..70f97491d8f2 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c | |||
@@ -513,20 +513,7 @@ static struct platform_driver timbuart_platform_driver = { | |||
513 | .remove = __devexit_p(timbuart_remove), | 513 | .remove = __devexit_p(timbuart_remove), |
514 | }; | 514 | }; |
515 | 515 | ||
516 | /*--------------------------------------------------------------------------*/ | 516 | module_platform_driver(timbuart_platform_driver); |
517 | |||
518 | static int __init timbuart_init(void) | ||
519 | { | ||
520 | return platform_driver_register(&timbuart_platform_driver); | ||
521 | } | ||
522 | |||
523 | static void __exit timbuart_exit(void) | ||
524 | { | ||
525 | platform_driver_unregister(&timbuart_platform_driver); | ||
526 | } | ||
527 | |||
528 | module_init(timbuart_init); | ||
529 | module_exit(timbuart_exit); | ||
530 | 517 | ||
531 | MODULE_DESCRIPTION("Timberdale UART driver"); | 518 | MODULE_DESCRIPTION("Timberdale UART driver"); |
532 | MODULE_LICENSE("GPL v2"); | 519 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c index 3beb6ab4fa68..83148e79ca13 100644 --- a/drivers/tty/serial/vr41xx_siu.c +++ b/drivers/tty/serial/vr41xx_siu.c | |||
@@ -961,18 +961,7 @@ static struct platform_driver siu_device_driver = { | |||
961 | }, | 961 | }, |
962 | }; | 962 | }; |
963 | 963 | ||
964 | static int __init vr41xx_siu_init(void) | 964 | module_platform_driver(siu_device_driver); |
965 | { | ||
966 | return platform_driver_register(&siu_device_driver); | ||
967 | } | ||
968 | |||
969 | static void __exit vr41xx_siu_exit(void) | ||
970 | { | ||
971 | platform_driver_unregister(&siu_device_driver); | ||
972 | } | ||
973 | |||
974 | module_init(vr41xx_siu_init); | ||
975 | module_exit(vr41xx_siu_exit); | ||
976 | 965 | ||
977 | MODULE_LICENSE("GPL"); | 966 | MODULE_LICENSE("GPL"); |
978 | MODULE_ALIAS("platform:SIU"); | 967 | MODULE_ALIAS("platform:SIU"); |