aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-09-08 07:12:18 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-26 18:36:07 -0400
commit865569ba5a8b0cc840e2b9c16ca6b42d6d5306b4 (patch)
treeb9f125ca3c3c6f3db2b131d65f58d026d5095b77 /drivers/usb/gadget
parent598f0b703506da841d3459dc0c48506be14d1778 (diff)
usb: gadget: udc-core: fix bug on soft_connect interface
We should not be using dev_get_drvdata() because we never call dev_set_drvdata(). Let's use container_of() as all other sysfs attributes. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/udc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 5e77a46a429a..022baeca7c94 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -356,7 +356,7 @@ static DEVICE_ATTR(srp, S_IWUSR, NULL, usb_udc_srp_store);
356static ssize_t usb_udc_softconn_store(struct device *dev, 356static ssize_t usb_udc_softconn_store(struct device *dev,
357 struct device_attribute *attr, const char *buf, size_t n) 357 struct device_attribute *attr, const char *buf, size_t n)
358{ 358{
359 struct usb_udc *udc = dev_get_drvdata(dev); 359 struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
360 360
361 if (sysfs_streq(buf, "connect")) { 361 if (sysfs_streq(buf, "connect")) {
362 usb_gadget_connect(udc->gadget); 362 usb_gadget_connect(udc->gadget);