aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAndreas Larsson <andreas@gaisler.com>2014-09-15 06:42:27 -0400
committerFelipe Balbi <balbi@ti.com>2014-09-16 11:01:45 -0400
commitaf54954ad02091506ced45588215d389d606f74e (patch)
treeeca3296c54fb2a6c81e557a61334526e90efbe77 /drivers/usb/gadget
parent468bcc2a2ca071f652009d2d20d97f2437630cae (diff)
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: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/udc/udc-core.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index ba661c6da54a..ad1ceac15468 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -109,8 +109,20 @@ EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
109static void usb_gadget_state_work(struct work_struct *work) 109static void usb_gadget_state_work(struct work_struct *work)
110{ 110{
111 struct usb_gadget *gadget = work_to_gadget(work); 111 struct usb_gadget *gadget = work_to_gadget(work);
112 struct usb_udc *udc = NULL;
113
114 mutex_lock(&udc_lock);
115 list_for_each_entry(udc, &udc_list, list)
116 if (udc->gadget == gadget)
117 goto found;
118 mutex_unlock(&udc_lock);
119
120 return;
121
122found:
123 mutex_unlock(&udc_lock);
112 124
113 sysfs_notify(&gadget->dev.kobj, NULL, "state"); 125 sysfs_notify(&udc->dev.kobj, NULL, "state");
114} 126}
115 127
116void usb_gadget_set_state(struct usb_gadget *gadget, 128void usb_gadget_set_state(struct usb_gadget *gadget,