ar5523: use module_usb_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 1 Nov 2012 01:59:13 +0000 (09:59 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 14 Nov 2012 19:55:35 +0000 (14:55 -0500)
Use the module_usb_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ar5523/ar5523.c

index f782b6e502bf0f6101af213e7ec12784d3344262..402e6d378b2ccc8e7e46716592671a0a17120c15 100644 (file)
@@ -1789,18 +1789,7 @@ static struct usb_driver ar5523_driver = {
        .disconnect     = ar5523_disconnect,
 };
 
-static int __init ar5523_init(void)
-{
-       return usb_register(&ar5523_driver);
-}
-
-static void __exit ar5523_exit(void)
-{
-       usb_deregister(&ar5523_driver);
-}
+module_usb_driver(ar5523_driver);
 
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_FIRMWARE(AR5523_FIRMWARE_FILE);
-
-module_init(ar5523_init);
-module_exit(ar5523_exit);