usb: gadget: dummy-hcd: remember to update driver pointer
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 20 Aug 2012 20:12:47 +0000 (16:12 -0400)
committerFelipe Balbi <balbi@ti.com>
Fri, 31 Aug 2012 09:41:39 +0000 (12:41 +0300)
This patch (as1599) fixes dummy-hcd to make it update the appropriate
driver pointer when a new gadget driver is bound or unbound.  Without
this change, the gadget driver's name doesn't appear in dev_printk
output.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/dummy_hcd.c

index b799106027adfc5d75a45244a47fbd015bedfd20..91916f693ff7462238f8ae0a51f79b00f3c7b9a1 100644 (file)
@@ -909,6 +909,7 @@ static int dummy_udc_start(struct usb_gadget *g,
        dum->devstatus = 0;
 
        dum->driver = driver;
+       dum->gadget.dev.driver = &driver->driver;
        dev_dbg(udc_dev(dum), "binding gadget driver '%s'\n",
                        driver->driver.name);
        return 0;
@@ -923,6 +924,7 @@ static int dummy_udc_stop(struct usb_gadget *g,
        dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
                        driver->driver.name);
 
+       dum->gadget.dev.driver = NULL;
        dum->driver = NULL;
 
        return 0;