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>
This commit is contained in:
parent
47c6a04bf5
commit
1d91a96268
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue