diff mbox series

[-next] usb: gadget: mass_storage: use module_usb_composite_driver to simplify the code

Message ID 20200428133934.73637-1-weiyongjun1@huawei.com (mailing list archive)
State Mainlined
Commit 46b11a91124d481ff4754ec624fc5393a515a361
Headers show
Series [-next] usb: gadget: mass_storage: use module_usb_composite_driver to simplify the code | expand

Commit Message

Wei Yongjun April 28, 2020, 1:39 p.m. UTC
module_usb_composite_driver() makes the code simpler by
eliminating boilerplate code.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/usb/gadget/legacy/mass_storage.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/legacy/mass_storage.c b/drivers/usb/gadget/legacy/mass_storage.c
index f18f77584fc2..9ed22c5fb7fe 100644
--- a/drivers/usb/gadget/legacy/mass_storage.c
+++ b/drivers/usb/gadget/legacy/mass_storage.c
@@ -229,18 +229,8 @@  static struct usb_composite_driver msg_driver = {
 	.unbind		= msg_unbind,
 };
 
+module_usb_composite_driver(msg_driver);
+
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_AUTHOR("Michal Nazarewicz");
 MODULE_LICENSE("GPL");
-
-static int __init msg_init(void)
-{
-	return usb_composite_probe(&msg_driver);
-}
-module_init(msg_init);
-
-static void __exit msg_cleanup(void)
-{
-	usb_composite_unregister(&msg_driver);
-}
-module_exit(msg_cleanup);