提交 865569ba 编写于 作者: F Felipe Balbi 提交者: Greg Kroah-Hartman

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: NFelipe Balbi <balbi@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 598f0b70
...@@ -356,7 +356,7 @@ static DEVICE_ATTR(srp, S_IWUSR, NULL, usb_udc_srp_store); ...@@ -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, static ssize_t usb_udc_softconn_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n) 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")) { if (sysfs_streq(buf, "connect")) {
usb_gadget_connect(udc->gadget); usb_gadget_connect(udc->gadget);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册