On Mon, Apr 25, 2005 at 04:01:07PM -0400, Alan Stern wrote: > I think usb_driver_claim_interface is correct as it stands. It was a > mistake to leave out from usb_driver_release_interface originally the line > setting iface->condition to USB_INTERFACE_UNBINDING.
But it would be asymmetric then. FWIW my personal preference would be to get rid of usb_interface.condition altogether, and always use the driver base facilities to deduce the current interface bound state. Otherwise maintaining a private field in sync with what the driver base thinks is always error prone. > > At any rate the driver can check for > > klist_node_attached(&dev->knode_bus) before claiming the device, and > > leave it alone if it's already attached to another driver. > > You mean ->knode_driver, not ->knode_bus. Right, that was a typo, sorry. > The _driver_ shouldn't check. The check should be part of the > driver-model core in __driver_attach, at the place where it checks whether > the device is already bound to a driver. In fact, this check can subsume > that one, since the klist_node will always be attached whenever the device > is bound. Indeed. I guess all checks for whether the device is associated with a driver ought to be changed from !dev->driver to klist_node_attached(&dev->knode_driver). Roman. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel