diff mbox series

[v3,3/4] usb: gadget: f_loopback: use DECLARE_USB_FUNCTION_INIT() macro

Message ID 1652097288-19909-4-git-send-email-quic_linyyuan@quicinc.com
State New
Headers show
Series usb: gadget: update DECLARE_USB_FUNCTION(_INIT) macro | expand

Commit Message

Linyu Yuan May 9, 2022, 11:54 a.m. UTC
As lb_modexit()/lb_modinit() just register/unregister
the loopback usb function driver,
DECLARE_USB_FUNCTION_INIT() macro do same thing,
let's use this macro instead and remove lb_modexit()//lb_modinit().

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
v3: new add according review comment

 drivers/usb/gadget/function/f_loopback.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

kernel test robot May 9, 2022, 7:22 p.m. UTC | #1
Hi Linyu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on v5.18-rc6 next-20220509]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Linyu-Yuan/usb-gadget-update-DECLARE_USB_FUNCTION-_INIT-macro/20220509-200328
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: alpha-randconfig-r024-20220509 (https://download.01.org/0day-ci/archive/20220510/202205100334.A5vWHYGj-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/9af25f078e024028630e40f8b81ae7e9d3b29554
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Linyu-Yuan/usb-gadget-update-DECLARE_USB_FUNCTION-_INIT-macro/20220509-200328
        git checkout 9af25f078e024028630e40f8b81ae7e9d3b29554
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=alpha SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   alpha-linux-ld: drivers/usb/gadget/function/f_sourcesink.o: in function `SourceSinkmod_init':
>> (.init.text+0x0): multiple definition of `init_module'; drivers/usb/gadget/function/f_loopback.o:(.init.text+0x0): first defined here
   alpha-linux-ld: drivers/usb/gadget/function/f_sourcesink.o: in function `SourceSinkmod_exit':
>> (.exit.text+0x0): multiple definition of `cleanup_module'; drivers/usb/gadget/function/f_loopback.o:(.exit.text+0x0): first defined here
diff mbox series

Patch

diff --git a/drivers/usb/gadget/function/f_loopback.c b/drivers/usb/gadget/function/f_loopback.c
index ae41f55..b0eda4f 100644
--- a/drivers/usb/gadget/function/f_loopback.c
+++ b/drivers/usb/gadget/function/f_loopback.c
@@ -583,16 +583,6 @@  static struct usb_function_instance *loopback_alloc_instance(void)
 
 	return  &lb_opts->func_inst;
 }
-DECLARE_USB_FUNCTION(Loopback, loopback_alloc_instance, loopback_alloc);
-
-int __init lb_modinit(void)
-{
-	return usb_function_register(&Loopbackusb_func);
-}
-
-void __exit lb_modexit(void)
-{
-	usb_function_unregister(&Loopbackusb_func);
-}
+DECLARE_USB_FUNCTION_INIT(Loopback, loopback_alloc_instance, loopback_alloc);
 
 MODULE_LICENSE("GPL");