Re: [patch 2.6.24-rc3] usb peripheral controller driver oops avoidance | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On Mon, 19 Nov 2007, David Brownell wrote: > 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; Now that I look back on it, it's not so clear that the scheme used by dummy_hcd is really correct. It registers a driver structure on the platform bus but embeds it inside a usb_gadget_driver instead of a platform_driver. This sounds like a bug waiting to happen. Maybe it would be better to change dummy_hcd to make it work like the other device controller drivers. There seems to be no advantage to registering the gadget driver in sysfs (and some disadvantage in that the Gadget API doesn't match up well with normal bus-oriented probe and remove methods). Greg, do you agree with that last sentence? Alan Stern ------------------------------------------------------------------------- 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/ _______________________________________________ linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[Home] [Video for Linux] [Photo] [Yosemite Forum] [Yosemite Photos] [Video Projectors] [PDAs] [Hacking TiVo] [Linux Kernel] [Linux SCSI] [XFree86] [Devices] [Big List of Linux Books] [Free Dating]
![]() |