summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-04-28 13:39:34 +0000
committerFelipe Balbi <balbi@kernel.org>2020-05-25 11:09:40 +0300
commit46b11a91124d481ff4754ec624fc5393a515a361 (patch)
treeb00e084814a9741a03c062e676e01bddd3a3621d /drivers/usb
parent55ee1bf91d6301a979c2981d626d6255bb367bdd (diff)
downloadlinux-46b11a91124d481ff4754ec624fc5393a515a361.tar.bz2
usb: gadget: mass_storage: use module_usb_composite_driver to simplify the code
module_usb_composite_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/legacy/mass_storage.c14
1 files changed, 2 insertions, 12 deletions
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);