提交 8e55d303 编写于 作者: L Li Jun 提交者: Felipe Balbi

usb: gadget: mass_storage: set msg_registered after msg registered

If there is no UDC available, the msg register will fail and this
flag will not be set, but the driver is already added into pending
driver list, then the module removal modprobe -r can not remove
the driver from the pending list.
Signed-off-by: NLi Jun <jun.li@nxp.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 2d4aa21a
...@@ -210,7 +210,6 @@ static int msg_bind(struct usb_composite_dev *cdev) ...@@ -210,7 +210,6 @@ static int msg_bind(struct usb_composite_dev *cdev)
usb_composite_overwrite_options(cdev, &coverwrite); usb_composite_overwrite_options(cdev, &coverwrite);
dev_info(&cdev->gadget->dev, dev_info(&cdev->gadget->dev,
DRIVER_DESC ", version: " DRIVER_VERSION "\n"); DRIVER_DESC ", version: " DRIVER_VERSION "\n");
set_bit(0, &msg_registered);
return 0; return 0;
fail_otg_desc: fail_otg_desc:
...@@ -257,7 +256,12 @@ MODULE_LICENSE("GPL"); ...@@ -257,7 +256,12 @@ MODULE_LICENSE("GPL");
static int __init msg_init(void) static int __init msg_init(void)
{ {
return usb_composite_probe(&msg_driver); int ret;
ret = usb_composite_probe(&msg_driver);
set_bit(0, &msg_registered);
return ret;
} }
module_init(msg_init); module_init(msg_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册