Commit 1935e357 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdac0f64
...@@ -151,47 +151,6 @@ static void metrousb_close (struct usb_serial_port *port) ...@@ -151,47 +151,6 @@ static void metrousb_close (struct usb_serial_port *port)
metrousb_cleanup(port); metrousb_cleanup(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: Description:
Open the drivers serial port. Open the drivers serial port.
...@@ -574,9 +533,8 @@ static void metrousb_unthrottle (struct tty_struct *tty) ...@@ -574,9 +533,8 @@ static void metrousb_unthrottle (struct tty_struct *tty)
} }
} }
/* Standard module function. */ module_usb_serial_driver(metrousb_driver, serial_drivers);
module_init(metrousb_init);
module_exit(metrousb_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR( "Philip Nicastro" ); MODULE_AUTHOR( "Philip Nicastro" );
MODULE_AUTHOR( "Aleksey Babahin <tamerlan311@gmail.com>" ); MODULE_AUTHOR( "Aleksey Babahin <tamerlan311@gmail.com>" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment