summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/pl2303.c
diff options
context:
space:
mode:
authorGreg KH <gregkh@linuxfoundation.org>2012-02-24 15:38:14 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-28 11:21:48 -0800
commitd1cddb4a8e9b09c33158acae05c48069d74fa4d0 (patch)
treee1ab740cc4a6905ef0a520dd79ecdbac041585a1 /drivers/usb/serial/pl2303.c
parent03892d5fefbe7d4df68466bd4cfda86fac84ebd8 (diff)
USB: create module_usb_serial_driver macro
Now that Alan Stern has cleaned up the usb serial driver registration, we have the ability to create a module_usb_serial_driver macro to make things a bit simpler, like the other *_driver macros created. But, as we need two functions here, we can't reuse the existing module_driver() macro, so we need to roll our own. Here's a patch implementing module_usb_serial_driver() and it converts the pl2303 driver to use it, showing a nice cleanup. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/pl2303.c')
-rw-r--r--drivers/usb/serial/pl2303.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index cc65d810c8f..ff4a174fa5d 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -855,23 +855,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
&pl2303_device, NULL
};
-static int __init pl2303_init(void)
-{
- int retval;
-
- retval = usb_serial_register_drivers(&pl2303_driver, serial_drivers);
- if (retval == 0)
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
- return retval;
-}
-
-static void __exit pl2303_exit(void)
-{
- usb_serial_deregister_drivers(&pl2303_driver, serial_drivers);
-}
-
-module_init(pl2303_init);
-module_exit(pl2303_exit);
+module_usb_serial_driver(pl2303_driver, serial_drivers);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");