Commit c8381c15b14b7c2d212c182d3b9b3fa7217994da

Authored by Axel Lin
Committed by Greg Kroah-Hartman
1 parent 782ee87702

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>

Showing 4 changed files with 4 additions and 50 deletions Side-by-side Diff

drivers/tty/serial/8250_dw.c
... ... @@ -177,17 +177,7 @@
177 177 .remove = __devexit_p(dw8250_remove),
178 178 };
179 179  
180   -static int __init dw8250_init(void)
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);
  180 +module_platform_driver(dw8250_platform_driver);
191 181  
192 182 MODULE_AUTHOR("Jamie Iles");
193 183 MODULE_LICENSE("GPL");
drivers/tty/serial/sc26xx.c
... ... @@ -736,19 +736,7 @@
736 736 },
737 737 };
738 738  
739   -static int __init sc26xx_init(void)
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   -
  739 +module_platform_driver(sc26xx_driver);
752 740  
753 741 MODULE_AUTHOR("Thomas Bogendörfer");
754 742 MODULE_DESCRIPTION("SC681/SC2692 serial driver");
drivers/tty/serial/timbuart.c
... ... @@ -513,20 +513,7 @@
513 513 .remove = __devexit_p(timbuart_remove),
514 514 };
515 515  
516   -/*--------------------------------------------------------------------------*/
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);
  516 +module_platform_driver(timbuart_platform_driver);
530 517  
531 518 MODULE_DESCRIPTION("Timberdale UART driver");
532 519 MODULE_LICENSE("GPL v2");
drivers/tty/serial/vr41xx_siu.c
... ... @@ -961,18 +961,7 @@
961 961 },
962 962 };
963 963  
964   -static int __init vr41xx_siu_init(void)
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);
  964 +module_platform_driver(siu_device_driver);
976 965  
977 966 MODULE_LICENSE("GPL");
978 967 MODULE_ALIAS("platform:SIU");