Re: [patch 2.6.24-rc3] usb peripheral controller driver oops avoidance

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Monday 19 November 2007, David Brownell wrote:
> OK, I'll take the dummy_hcd bit out -- but add a comment to
> highlight this unique behavior.

Currently expecting:

--- at91.orig/drivers/usb/gadget/dummy_hcd.c	2007-11-19 13:58:57.000000000 -0800
+++ at91/drivers/usb/gadget/dummy_hcd.c	2007-11-19 13:58:55.000000000 -0800
@@ -779,6 +779,13 @@ usb_gadget_register_driver (struct usb_g
 	if ((retval = driver->bind (&dum->gadget)) != 0)
 		goto err_bind_gadget;
 
+	/* NOTE:  most peripheral controller drivers won't bother
+	 * registering the gadget drivers, since doing that requires
+	 * that the driver be associated with a bus.  There's really
+	 * no existing bus that's appropriate for a gadget driver,
+	 * and little point in defining a "bus" that must never have
+	 * more than one device.
+	 */
 	driver->driver.bus = dum->gadget.dev.parent->bus;
 	if ((retval = driver_register (&driver->driver)) != 0)
 		goto err_register;
@@ -830,7 +837,6 @@ usb_gadget_unregister_driver (struct usb
 	spin_unlock_irqrestore (&dum->lock, flags);
 
 	driver->unbind (&dum->gadget);
-	dum->gadget.dev.driver = NULL;
 	dum->driver = NULL;
 
 	device_release_driver (&dum->gadget.dev);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.