aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/udc-core.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-02-26 06:51:24 -0500
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:17:30 -0400
commit70d3a49878cb3fc0e5ec0bd1e607c7ac63743f67 (patch)
tree14403fa1cc47e2785835a23aa684868b14be41ac /drivers/usb/gadget/udc-core.c
parent8a1c33075e5e42074397aa8478fc16481e306b31 (diff)
usb: gadget: udc-core: initialize gadget->dev.driver
if we initialize gadget->dev.driver ourselves, UDC drivers won't have to do the same, so we can remove some duplicated code. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/udc-core.c')
-rw-r--r--drivers/usb/gadget/udc-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 447a1614736e..2423d024654f 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -247,6 +247,7 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
247 247
248 udc->driver = NULL; 248 udc->driver = NULL;
249 udc->dev.driver = NULL; 249 udc->dev.driver = NULL;
250 udc->gadget->dev.driver = NULL;
250} 251}
251 252
252/** 253/**
@@ -296,6 +297,7 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
296 297
297 udc->driver = driver; 298 udc->driver = driver;
298 udc->dev.driver = &driver->driver; 299 udc->dev.driver = &driver->driver;
300 udc->gadget->dev.driver = &driver->driver;
299 301
300 ret = driver->bind(udc->gadget, driver); 302 ret = driver->bind(udc->gadget, driver);
301 if (ret) 303 if (ret)
@@ -314,6 +316,7 @@ err1:
314 udc->driver->function, ret); 316 udc->driver->function, ret);
315 udc->driver = NULL; 317 udc->driver = NULL;
316 udc->dev.driver = NULL; 318 udc->dev.driver = NULL;
319 udc->gadget->dev.driver = NULL;
317 return ret; 320 return ret;
318} 321}
319 322