提交 af54954a 编写于 作者: A Andreas Larsson 提交者: Felipe Balbi

usb: gadget: udc_core: Use right kobj when calling sysfs_notify

The state attribute is connected to the kobj of the udc, not the gadget.
Signed-off-by: NAndreas Larsson <andreas@gaisler.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 468bcc2a
......@@ -109,8 +109,20 @@ EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
static void usb_gadget_state_work(struct work_struct *work)
{
struct usb_gadget *gadget = work_to_gadget(work);
struct usb_udc *udc = NULL;
mutex_lock(&udc_lock);
list_for_each_entry(udc, &udc_list, list)
if (udc->gadget == gadget)
goto found;
mutex_unlock(&udc_lock);
return;
found:
mutex_unlock(&udc_lock);
sysfs_notify(&gadget->dev.kobj, NULL, "state");
sysfs_notify(&udc->dev.kobj, NULL, "state");
}
void usb_gadget_set_state(struct usb_gadget *gadget,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册