USB: serial: ch341.c: use module_usb_serial_driver
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Feb 2012 21:11:37 +0000 (13:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Feb 2012 21:11:37 +0000 (13:11 -0800)
This converts the ch341.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.

CC: Johan Hovold <jhovold@gmail.com>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ch341.c

index 23de3b039a28af03fa89a00595a9f8c568e8e326..aaab32db31d039d415bcb8fe17fbfd8fd74fbbea 100644 (file)
@@ -652,21 +652,9 @@ static struct usb_serial_driver * const serial_drivers[] = {
        &ch341_device, NULL
 };
 
-static int __init ch341_init(void)
-{
-       return usb_serial_register_drivers(&ch341_driver, serial_drivers);
-}
-
-static void __exit ch341_exit(void)
-{
-       usb_serial_deregister_drivers(&ch341_driver, serial_drivers);
-}
+module_usb_serial_driver(ch341_driver, serial_drivers);
 
-module_init(ch341_init);
-module_exit(ch341_exit);
 MODULE_LICENSE("GPL");
 
 module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
-/* EOF ch341.c */