[45/67] usb: gadget: udc: dummy: do not rely on 'driver' argument

Message ID 1413566234-13537-46-git-send-email-balbi@ti.com
State Accepted
Commit 96a5361aab7a89cf80cb4fe03966f55f00b0d91f
Headers show

Commit Message

Felipe Balbi Oct. 17, 2014, 5:16 p.m.
future patches will remove the extra 'driver'
argument to ->udc_stop(), in order to do that,
we must make sure that our UDC does not rely
on it first.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/gadget/udc/dummy_hcd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 81dc595..32bdd78 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -921,9 +921,8 @@  static int dummy_udc_stop(struct usb_gadget *g,
 	struct dummy_hcd	*dum_hcd = gadget_to_dummy_hcd(g);
 	struct dummy		*dum = dum_hcd->dum;
 
-	if (driver)
-		dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
-				driver->driver.name);
+	dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
+			dum->driver->driver.name);
 
 	dum->driver = NULL;