From: Felipe Balbi Date: Thu, 8 Sep 2011 11:12:18 +0000 (+0300) Subject: usb: gadget: udc-core: fix bug on soft_connect interface X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=865569ba5a8b0cc840e2b9c16ca6b42d6d5306b4;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index 5e77a46a429..022baeca7c9 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); static ssize_t usb_udc_softconn_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, "connect")) { usb_gadget_connect(udc->gadget);