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@xxxxxxxxxxx> --- v3: new add according review comment drivers/usb/gadget/function/f_loopback.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) 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"); -- 2.7.4