aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_edgeport.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-28 16:11:51 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-28 16:11:51 -0500
commit36ccce49128c1bce042273ee723e93f7cca06330 (patch)
tree78114830d0ee38afb46d5b95eeea1a347f6d8807 /drivers/usb/serial/io_edgeport.c
parent68e9c9a7fdbddab3407596b3e7f1a4972d045444 (diff)
USB: serial: io_edgeport.c: use module_usb_serial_driver
This converts the io_edgeport.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: Huzaifa Sidhpurwala <huzaifas@redhat.com> CC: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/io_edgeport.c')
-rw-r--r--drivers/usb/serial/io_edgeport.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 55afa233aac..323e8723571 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -193,7 +193,8 @@ static const struct divisor_table_entry divisor_table[] = {
193/* local variables */ 193/* local variables */
194static bool debug; 194static bool debug;
195 195
196static atomic_t CmdUrbs; /* Number of outstanding Command Write Urbs */ 196/* Number of outstanding Command Write Urbs */
197static atomic_t CmdUrbs = ATOMIC_INIT(0);
197 198
198 199
199/* local function prototypes */ 200/* local function prototypes */
@@ -3180,38 +3181,8 @@ static void edge_release(struct usb_serial *serial)
3180 kfree(edge_serial); 3181 kfree(edge_serial);
3181} 3182}
3182 3183
3184module_usb_serial_driver(io_driver, serial_drivers);
3183 3185
3184/****************************************************************************
3185 * edgeport_init
3186 * This is called by the module subsystem, or on startup to initialize us
3187 ****************************************************************************/
3188static int __init edgeport_init(void)
3189{
3190 int retval;
3191
3192 retval = usb_serial_register_drivers(&io_driver, serial_drivers);
3193 if (retval == 0) {
3194 atomic_set(&CmdUrbs, 0);
3195 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
3196 DRIVER_DESC "\n");
3197 }
3198 return retval;
3199}
3200
3201
3202/****************************************************************************
3203 * edgeport_exit
3204 * Called when the driver is about to be unloaded.
3205 ****************************************************************************/
3206static void __exit edgeport_exit (void)
3207{
3208 usb_serial_deregister_drivers(&io_driver, serial_drivers);
3209}
3210
3211module_init(edgeport_init);
3212module_exit(edgeport_exit);
3213
3214/* Module information */
3215MODULE_AUTHOR(DRIVER_AUTHOR); 3186MODULE_AUTHOR(DRIVER_AUTHOR);
3216MODULE_DESCRIPTION(DRIVER_DESC); 3187MODULE_DESCRIPTION(DRIVER_DESC);
3217MODULE_LICENSE("GPL"); 3188MODULE_LICENSE("GPL");