The only difference is that the first replacement in usb_gadget_unregister_driver() now also calls usb_hcd_poll_rh_status(). It doesn't look like it causes any harm. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> --- drivers/usb/gadget/dummy_hcd.c | 20 +++----------------- 1 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 3214ca3..8243d8c 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -804,12 +804,7 @@ usb_gadget_probe_driver(struct usb_gadget_driver *driver, } /* khubd will enumerate this in a while */ - spin_lock_irq (&dum->lock); - dum->pullup = 1; - set_link_state (dum); - spin_unlock_irq (&dum->lock); - - usb_hcd_poll_rh_status (dummy_to_hcd (dum)); + dummy_pullup(&dum->gadget, 1); return 0; } EXPORT_SYMBOL(usb_gadget_probe_driver); @@ -818,7 +813,6 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) { struct dummy *dum = the_controller; - unsigned long flags; if (!dum) return -ENODEV; @@ -828,21 +822,13 @@ usb_gadget_unregister_driver (struct usb_gadget_driver *driver) dev_dbg (udc_dev(dum), "unregister gadget driver '%s'\n", driver->driver.name); - spin_lock_irqsave (&dum->lock, flags); - dum->pullup = 0; - set_link_state (dum); - spin_unlock_irqrestore (&dum->lock, flags); + dummy_pullup(&dum->gadget, 0); driver->unbind (&dum->gadget); dum->gadget.dev.driver = NULL; dum->driver = NULL; - spin_lock_irqsave (&dum->lock, flags); - dum->pullup = 0; - set_link_state (dum); - spin_unlock_irqrestore (&dum->lock, flags); - - usb_hcd_poll_rh_status (dummy_to_hcd (dum)); + dummy_pullup(&dum->gadget, 0); return 0; } EXPORT_SYMBOL (usb_gadget_unregister_driver); -- 1.7.4.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html