Skip to content

Commit

Permalink
usb: gadget: udc-core: fix bug on soft_connect interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Sep 26, 2011
1 parent 598f0b7 commit 865569b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 865569b

Please sign in to comment.