]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath9k_htc: use module_usb_driver
authorRosen Penev <rosenp@gmail.com>
Wed, 6 May 2026 23:48:48 +0000 (16:48 -0700)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Sat, 6 Jun 2026 15:46:29 +0000 (08:46 -0700)
This follows the pattern with other USB Wifi drivers. There is nothing
special being done in the _init and _exit functions here. Simplifies and
saves some lines of code.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260506234848.189840-1-rosenp@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath9k/hif_usb.c
drivers/net/wireless/ath/ath9k/hif_usb.h
drivers/net/wireless/ath/ath9k/htc_drv_init.c

index 821909b81ea917559400c6c6a1ce2afefd1265c5..7ad85a712757e727b086e37f5ee83caeba6adf41 100644 (file)
@@ -1530,12 +1530,4 @@ static struct usb_driver ath9k_hif_usb_driver = {
        .disable_hub_initiated_lpm = 1,
 };
 
-int ath9k_hif_usb_init(void)
-{
-       return usb_register(&ath9k_hif_usb_driver);
-}
-
-void ath9k_hif_usb_exit(void)
-{
-       usb_deregister(&ath9k_hif_usb_driver);
-}
+module_usb_driver(ath9k_hif_usb_driver);
index b3e66b0485a5637b1121a5e3578c5b748dbaf38c..c836bbe23b7a2bcacbcbd22923dbb9459f1619b1 100644 (file)
@@ -136,8 +136,6 @@ struct hif_device_usb {
        u8 flags; /* HIF_USB_* */
 };
 
-int ath9k_hif_usb_init(void);
-void ath9k_hif_usb_exit(void);
 void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev);
 
 #endif /* HTC_USB_H */
index 5270d0c0af170d59eff4aa7e488ff2794d26094a..6de78ae8572687984937e4eefaaf85021df195d2 100644 (file)
@@ -1021,21 +1021,3 @@ int ath9k_htc_resume(struct htc_target *htc_handle)
        return ret;
 }
 #endif
-
-static int __init ath9k_htc_init(void)
-{
-       if (ath9k_hif_usb_init() < 0) {
-               pr_err("No USB devices found, driver not installed\n");
-               return -ENODEV;
-       }
-
-       return 0;
-}
-module_init(ath9k_htc_init);
-
-static void __exit ath9k_htc_exit(void)
-{
-       ath9k_hif_usb_exit();
-       pr_info("Driver unloaded\n");
-}
-module_exit(ath9k_htc_exit);