summaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 13:39:53 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 13:39:53 -0800
commit1935e357bb2a3031772730293a3725e3cca07778 (patch)
treeea1b1cea354bb6bb149d7a65cf72b95df20f13cf /drivers/usb/serial
parentfdac0f647a2cf12e7152dc1d94dd08a1af4a2a82 (diff)
USB: serial: metro-usb: convert to use module_usb_serial_driver
Now that we aren't doing anything special in the init function, move to use the easier module_usb_serial_driver() call instead, saving a lot of lines of unnecessary code. Cc: Aleksey Babahin <tamerlan311@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/metro-usb.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c
index d0c47e1dab10..919dd47ab46f 100644
--- a/drivers/usb/serial/metro-usb.c
+++ b/drivers/usb/serial/metro-usb.c
@@ -153,47 +153,6 @@ static void metrousb_close (struct usb_serial_port *port)
/* ----------------------------------------------------------------------------------------------
Description:
- Driver exit.
-
- Input:
- None:
-
- Output:
- None:
-*/
-static void __exit metrousb_exit(void)
-{
- usb_serial_deregister_drivers(&metrousb_driver, serial_drivers);
-}
-
-/* ----------------------------------------------------------------------------------------------
- Description:
- Driver initialization.
-
- Input:
- None:
-
- Output:
- int: Returns true (0) if successful, false otherwise.
-*/
-static int __init metrousb_init(void)
-{
- int retval = 0;
-
- dbg("METRO-USB - %s", __FUNCTION__);
-
- /* Register the devices. */
- retval = usb_serial_register_drivers(&metrousb_driver, serial_drivers);
- if (retval)
- return retval;
-
- printk(KERN_INFO DRIVER_DESC " : " DRIVER_VERSION);
-
- return retval;
-}
-
-/* ----------------------------------------------------------------------------------------------
- Description:
Open the drivers serial port.
Input:
@@ -574,9 +533,8 @@ static void metrousb_unthrottle (struct tty_struct *tty)
}
}
-/* Standard module function. */
-module_init(metrousb_init);
-module_exit(metrousb_exit);
+module_usb_serial_driver(metrousb_driver, serial_drivers);
+
MODULE_LICENSE("GPL");
MODULE_AUTHOR( "Philip Nicastro" );
MODULE_AUTHOR( "Aleksey Babahin <tamerlan311@gmail.com>" );