USB: serial: use module_driver() macro
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Mar 2012 00:38:14 +0000 (16:38 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Mar 2012 00:38:14 +0000 (16:38 -0800)
Now that module_driver() can handle varargs, use it instead of rolling
our own version.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/usb/serial.h

index 7b1db841e2a895d5e3d03dfe7de7e1b5d4157dc1..fbb666b1b67008ef38d9f7c2b0e9682e924fbae7 100644 (file)
@@ -416,23 +416,10 @@ do {                                                                      \
  * module may only use this macro once, and calling it replaces
  * module_init() and module_exit()
  *
- * Note, we can't use the generic module_driver() call here, due to the
- * two parameters in the usb_serial_* functions, so we roll our own here
- * :(
  */
 #define module_usb_serial_driver(__usb_driver, __serial_drivers)       \
-static int __init usb_serial_driver_init(void)                         \
-{                                                                      \
-       return usb_serial_register_drivers(&(__usb_driver),             \
-                                          (__serial_drivers));         \
-}                                                                      \
-module_init(usb_serial_driver_init);                                   \
-static void __exit usb_serial_driver_exit(void)                                \
-{                                                                      \
-       return usb_serial_deregister_drivers(&(__usb_driver),           \
-                                            (__serial_drivers));       \
-}                                                                      \
-module_exit(usb_serial_driver_exit);
+       module_driver(__usb_driver, usb_serial_register_drivers,        \
+                      usb_serial_deregister_drivers, __serial_drivers)
 
 #endif /* __LINUX_USB_SERIAL_H */