summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/garmin_gps.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-28 22:11:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-28 22:11:46 +0100
commitdb62c08128acdb6f37038f3711621b52963fe5eb (patch)
tree95692737d8d643159b207ebd17d19534ba370f0d /drivers/usb/serial/garmin_gps.c
parentUSB: serial: funsoft.c: use module_usb_serial_driver (diff)
downloadlinux-db62c08128acdb6f37038f3711621b52963fe5eb.tar.xz
linux-db62c08128acdb6f37038f3711621b52963fe5eb.zip
USB: serial: garmin_gps.c: use module_usb_serial_driver
This converts the garmin_gps.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: Andrew Morton <akpm@linux-foundation.org> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/garmin_gps.c')
-rw-r--r--drivers/usb/serial/garmin_gps.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 69da3abcb363..e8eb6347bf3a 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -1516,29 +1516,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
&garmin_device, NULL
};
-
-static int __init garmin_init(void)
-{
- int retval;
-
- retval = usb_serial_register_drivers(&garmin_driver, serial_drivers);
- if (retval == 0)
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
- DRIVER_DESC "\n");
- return retval;
-}
-
-
-static void __exit garmin_exit(void)
-{
- usb_serial_deregister_drivers(&garmin_driver, serial_drivers);
-}
-
-
-
-
-module_init(garmin_init);
-module_exit(garmin_exit);
+module_usb_serial_driver(garmin_driver, serial_drivers);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
@@ -1548,4 +1526,3 @@ module_param(debug, bool, S_IWUSR | S_IRUGO);
MODULE_PARM_DESC(debug, "Debug enabled or not");
module_param(initial_mode, int, S_IRUGO);
MODULE_PARM_DESC(initial_mode, "Initial mode");
-