ath6kl: convert a driver to use module_usb_driver()
authorHimangi Saraogi <himangi774@gmail.com>
Fri, 1 Aug 2014 16:11:15 +0000 (21:41 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 4 Aug 2014 06:10:53 +0000 (09:10 +0300)
This converts a driver in drivers/net/* to use the
module_usb_driver() macro which makes the code smaller and a
bit simpler.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/usb.c

index c44325856b81fc4cee191ec9aceb2102f2f0b23b..a6a5e40b3e981453b72233e930e712c8412bf60e 100644 (file)
@@ -1229,26 +1229,7 @@ static struct usb_driver ath6kl_usb_driver = {
        .disable_hub_initiated_lpm = 1,
 };
 
-static int ath6kl_usb_init(void)
-{
-       int ret;
-
-       ret = usb_register(&ath6kl_usb_driver);
-       if (ret) {
-               ath6kl_err("usb registration failed: %d\n", ret);
-               return ret;
-       }
-
-       return 0;
-}
-
-static void ath6kl_usb_exit(void)
-{
-       usb_deregister(&ath6kl_usb_driver);
-}
-
-module_init(ath6kl_usb_init);
-module_exit(ath6kl_usb_exit);
+module_usb_driver(ath6kl_usb_driver);
 
 MODULE_AUTHOR("Atheros Communications, Inc.");
 MODULE_DESCRIPTION("Driver support for Atheros AR600x USB devices");