diff mbox series

[1/2] wifi: ath9k_htc: use module_usb_driver

Message ID 20230826200929.9756-1-rosenp@gmail.com
State New
Headers show
Series [1/2] wifi: ath9k_htc: use module_usb_driver | expand

Commit Message

Rosen Penev Aug. 26, 2023, 8:09 p.m. UTC
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>
---
 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(-)

Comments

kernel test robot Aug. 27, 2023, 12:38 a.m. UTC | #1
Hi Rosen,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kvalo-ath/ath-next]
[also build test WARNING on wireless-next/main wireless/main linus/master v6.5-rc7 next-20230825]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Rosen-Penev/wifi-purelifi-use-module_usb_driver/20230827-041155
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
patch link:    https://lore.kernel.org/r/20230826200929.9756-1-rosenp%40gmail.com
patch subject: [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230827/202308270817.fkin6iCi-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230827/202308270817.fkin6iCi-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308270817.fkin6iCi-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/ath/ath9k/hif_usb.c:1525:26: warning: 'ath9k_hif_usb_driver' defined but not used [-Wunused-variable]
    1525 | static struct usb_driver ath9k_hif_usb_driver = {
         |                          ^~~~~~~~~~~~~~~~~~~~


vim +/ath9k_hif_usb_driver +1525 drivers/net/wireless/ath/ath9k/hif_usb.c

fb9987d0f748c9 Sujith 2010-03-17  1524  
fb9987d0f748c9 Sujith 2010-03-17 @1525  static struct usb_driver ath9k_hif_usb_driver = {
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 27ff1ca2631f..e261e4258f0a 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1535,13 +1535,3 @@  static struct usb_driver ath9k_hif_usb_driver = {
 	.soft_unbind = 1,
 	.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);
-}
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
index 5985aa15ca93..6a7da71c9da6 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.h
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
@@ -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 */
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index dae3d9c7b640..beaaa31f32a5 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -1018,20 +1018,4 @@  int ath9k_htc_resume(struct htc_target *htc_handle)
 }
 #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);
+module_usb_driver(ath9k_hif_usb_driver)