Skip to contentSkip to conversation

wifi: ath9k_htc: use module_usb_driver

PATCH Applied Rosen Penev 3 participants 3 messages May 6 – Jun 6 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wifi: ath9k_htc: use module_usb_driver

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.

---
v2: move module_usb_driver to its proper place.

 drivers/net/wireless/ath/ath9k/hif_usb.c      | 10 +---------
 drivers/net/wireless/ath/ath9k/hif_usb.h      |  2 --
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 18 ------------------
 3 files changed, 1 insertion(+), 29 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +1 -9
index 8ae4e5d4fa14..515267f48d80 100644
@@ -1520,12 +1520,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);
drivers/net/wireless/ath/ath9k/hif_usb.h +0 -2
index c28033ee61ce..dc0b0fa5c325 100644
@@ -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 */
drivers/net/wireless/ath/ath9k/htc_drv_init.c +0 -18
index 5270d0c0af17..6de78ae85726 100644
@@ -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);
Signature · 1 line
2.54.0
Applied
#2 lore raw
In reply to Rosen Penev
Quoted 5 lines · Rosen Penev

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.

Applied, thanks!

[1/1] wifi: ath9k_htc: use module_usb_driver

      commit: 6a03ff9d5765ab701c12c9fc781fa6de171e1a2e

Best regards,

Signature · 1 line
Jeff Johnson <[email protected]>