Commit 59331017 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: dummy_hcd: don't register drivers on the platform bus

This patch (as1017) makes dummy_hcd behave more like the other USB
peripheral controller drivers by no longer registering its
gadget driver on the platform bus.  Doing that has always been a
mistake, since a usb_gadget_driver isn't a platform_driver.  Instead
the gadget driver is left unregistered in sysfs.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 90da096e
...@@ -772,18 +772,17 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver) ...@@ -772,18 +772,17 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
list_del_init (&dum->ep [0].ep.ep_list); list_del_init (&dum->ep [0].ep.ep_list);
INIT_LIST_HEAD(&dum->fifo_req.queue); INIT_LIST_HEAD(&dum->fifo_req.queue);
driver->driver.bus = NULL;
dum->driver = driver; dum->driver = driver;
dum->gadget.dev.driver = &driver->driver; dum->gadget.dev.driver = &driver->driver;
dev_dbg (udc_dev(dum), "binding gadget driver '%s'\n", dev_dbg (udc_dev(dum), "binding gadget driver '%s'\n",
driver->driver.name); driver->driver.name);
if ((retval = driver->bind (&dum->gadget)) != 0) retval = driver->bind(&dum->gadget);
goto err_bind_gadget; if (retval) {
dum->driver = NULL;
driver->driver.bus = dum->gadget.dev.parent->bus; dum->gadget.dev.driver = NULL;
if ((retval = driver_register (&driver->driver)) != 0) return retval;
goto err_register; }
if ((retval = device_bind_driver (&dum->gadget.dev)) != 0)
goto err_bind_driver;
/* khubd will enumerate this in a while */ /* khubd will enumerate this in a while */
spin_lock_irq (&dum->lock); spin_lock_irq (&dum->lock);
...@@ -793,20 +792,6 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver) ...@@ -793,20 +792,6 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
usb_hcd_poll_rh_status (dummy_to_hcd (dum)); usb_hcd_poll_rh_status (dummy_to_hcd (dum));
return 0; return 0;
err_bind_driver:
driver_unregister (&driver->driver);
err_register:
if (driver->unbind)
driver->unbind (&dum->gadget);
spin_lock_irq (&dum->lock);
dum->pullup = 0;
set_link_state (dum);
spin_unlock_irq (&dum->lock);
err_bind_gadget:
dum->driver = NULL;
dum->gadget.dev.driver = NULL;
return retval;
} }
EXPORT_SYMBOL (usb_gadget_register_driver); EXPORT_SYMBOL (usb_gadget_register_driver);
...@@ -830,11 +815,9 @@ usb_gadget_unregister_driver (struct usb_gadget_driver *driver) ...@@ -830,11 +815,9 @@ usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
spin_unlock_irqrestore (&dum->lock, flags); spin_unlock_irqrestore (&dum->lock, flags);
driver->unbind (&dum->gadget); driver->unbind (&dum->gadget);
dum->gadget.dev.driver = NULL;
dum->driver = NULL; dum->driver = NULL;
device_release_driver (&dum->gadget.dev);
driver_unregister (&driver->driver);
spin_lock_irqsave (&dum->lock, flags); spin_lock_irqsave (&dum->lock, flags);
dum->pullup = 0; dum->pullup = 0;
set_link_state (dum); set_link_state (dum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment