From: Felipe Balbi Date: Thu, 8 Sep 2011 11:11:17 +0000 (+0300) Subject: usb: gadget: udc-core: fix bug on soft_connect and srp interfaces X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1d91a96268a0b2d7301c3ee67a784b712f34010f;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- 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);