linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver
@ 2023-08-26 20:09 Rosen Penev
  2023-08-26 20:09 ` [PATCH 2/2] wifi: purelifi: " Rosen Penev
  2023-08-27  0:38 ` [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Rosen Penev @ 2023-08-26 20:09 UTC (permalink / raw)
  To: linux-wireless

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(-)

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)
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] wifi: purelifi: use module_usb_driver
  2023-08-26 20:09 [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver Rosen Penev
@ 2023-08-26 20:09 ` Rosen Penev
  2023-09-04 17:31   ` [2/2] wifi: plfxlc: use module_usb_driver() Kalle Valo
  2023-08-27  0:38 ` [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver kernel test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Rosen Penev @ 2023-08-26 20:09 UTC (permalink / raw)
  To: linux-wireless

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/purelifi/plfxlc/usb.c | 23 +---------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c
index 76d0a778636a..b4bb32911d9f 100644
--- a/drivers/net/wireless/purelifi/plfxlc/usb.c
+++ b/drivers/net/wireless/purelifi/plfxlc/usb.c
@@ -861,26 +861,6 @@ static struct usb_driver driver = {
 	.disable_hub_initiated_lpm = 1,
 };
 
-static int __init usb_init(void)
-{
-	int r;
-
-	r = usb_register(&driver);
-	if (r) {
-		pr_err("%s usb_register() failed %d\n", driver.name, r);
-		return r;
-	}
-
-	pr_debug("Driver initialized :%s\n", driver.name);
-	return 0;
-}
-
-static void __exit usb_exit(void)
-{
-	usb_deregister(&driver);
-	pr_debug("%s %s\n", driver.name, __func__);
-}
-
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("USB driver for pureLiFi devices");
 MODULE_AUTHOR("pureLiFi");
@@ -888,5 +868,4 @@ MODULE_VERSION("1.0");
 MODULE_FIRMWARE("plfxlc/lifi-x.bin");
 MODULE_DEVICE_TABLE(usb, usb_ids);
 
-module_init(usb_init);
-module_exit(usb_exit);
+module_usb_driver(driver);
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver
  2023-08-26 20:09 [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver Rosen Penev
  2023-08-26 20:09 ` [PATCH 2/2] wifi: purelifi: " Rosen Penev
@ 2023-08-27  0:38 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-08-27  0:38 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless; +Cc: oe-kbuild-all

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 = {

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [2/2] wifi: plfxlc: use module_usb_driver()
  2023-08-26 20:09 ` [PATCH 2/2] wifi: purelifi: " Rosen Penev
@ 2023-09-04 17:31   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2023-09-04 17:31 UTC (permalink / raw)
  To: Rosen Penev; +Cc: linux-wireless

Rosen Penev <rosenp@gmail.com> wrote:

> 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>

Fails to compile:

In file included from ./include/linux/device.h:32,
                 from drivers/net/wireless/purelifi/plfxlc/usb.c:8:
drivers/net/wireless/purelifi/plfxlc/usb.c:871:19: error: conflicting types for 'driver_init'; have 'int(void)'
  871 | module_usb_driver(driver);
      |                   ^~~~~~
./include/linux/device/driver.h:258:19: note: in definition of macro 'module_driver'
  258 | static int __init __driver##_init(void) \
      |                   ^~~~~~~~
drivers/net/wireless/purelifi/plfxlc/usb.c:871:1: note: in expansion of macro 'module_usb_driver'
  871 | module_usb_driver(driver);
      | ^~~~~~~~~~~~~~~~~
./include/linux/device/driver.h:241:6: note: previous declaration of 'driver_init' with type 'void(void)'
  241 | void driver_init(void);
      |      ^~~~~~~~~~~
make[7]: *** [scripts/Makefile.build:243: drivers/net/wireless/purelifi/plfxlc/usb.o] Error 1
make[6]: *** [scripts/Makefile.build:480: drivers/net/wireless/purelifi/plfxlc] Error 2
make[5]: *** [scripts/Makefile.build:480: drivers/net/wireless/purelifi] Error 2
make[4]: *** [scripts/Makefile.build:480: drivers/net/wireless] Error 2
make[3]: *** [scripts/Makefile.build:480: drivers/net] Error 2
make[2]: *** [scripts/Makefile.build:480: drivers] Error 2
make[1]: *** [/home/kvalo/projects/personal/wireless-drivers/src/wireless-next/Makefile:2032: .] Error 2
make: *** [Makefile:234: __sub-make] Error 2

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230826200929.9756-2-rosenp@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-04 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-26 20:09 [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver Rosen Penev
2023-08-26 20:09 ` [PATCH 2/2] wifi: purelifi: " Rosen Penev
2023-09-04 17:31   ` [2/2] wifi: plfxlc: use module_usb_driver() Kalle Valo
2023-08-27  0:38 ` [PATCH 1/2] wifi: ath9k_htc: use module_usb_driver kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).