summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-09-08 14:11:17 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-14 11:51:15 -0800
commit1d91a96268a0b2d7301c3ee67a784b712f34010f (patch)
treeff1145bcd024778d9497c650ebc4c60cf2683873 /drivers
parent47c6a04bf58163fe2a429617ae6b1a93ba363723 (diff)
usb: gadget: udc-core: fix bug on soft_connect and srp interfaces
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')
-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 022baeca7c94..31e410bbe55a 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -344,7 +344,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_unregister_driver);
static ssize_t usb_udc_srp_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n)
{
- struct usb_udc *udc = dev_get_drvdata(dev);
+ struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
if (sysfs_streq(buf, "1"))
usb_gadget_wakeup(udc->gadget);