diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-29 01:12:10 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-29 01:12:10 +0400 |
commit | e7414d9a6d71027a2a0e8e4af6ef3cca7eaef80a (patch) | |
tree | d796b2f81bfcb766ec83d2a69650d15a9055b834 /drivers/usb/serial/mos7840.c | |
parent | 964e2b8425f5f37baa4f1fe6c15cdaf258d5cb51 (diff) | |
download | linux-e7414d9a6d71027a2a0e8e4af6ef3cca7eaef80a.tar.xz |
USB: serial: mos7840.c: use module_usb_serial_driver
This converts the mos7840.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>
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r-- | drivers/usb/serial/mos7840.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index b45522e12f68..f7e6e30f53ee 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -2676,43 +2676,8 @@ static struct usb_serial_driver * const serial_drivers[] = { &moschip7840_4port_device, NULL }; -/**************************************************************************** - * moschip7840_init - * This is called by the module subsystem, or on startup to initialize us - ****************************************************************************/ -static int __init moschip7840_init(void) -{ - int retval; - - dbg("%s", " mos7840_init :entering.........."); - - retval = usb_serial_register_drivers(&io_driver, serial_drivers); - if (retval == 0) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); - - dbg("%s", "Leaving..."); - return retval; -} - -/**************************************************************************** - * moschip7840_exit - * Called when the driver is about to be unloaded. - ****************************************************************************/ -static void __exit moschip7840_exit(void) -{ - - dbg("%s", " mos7840_exit :entering.........."); - - usb_serial_deregister_drivers(&io_driver, serial_drivers); - - dbg("%s", "Entering..."); -} - -module_init(moschip7840_init); -module_exit(moschip7840_exit); +module_usb_serial_driver(io_driver, serial_drivers); -/* Module information */ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); |