On Tue, 30 Aug 2005, Daniel Ritz wrote: > On Tuesday 30 August 2005 16.14, Alan Stern wrote: > > On Tue, 30 Aug 2005, Daniel Ritz wrote: > > > > > if i didn't miss anything usb's check for knode_bus is also workaround > > > to avoid a double device_bind_driver()... > > > > That's not really right. The actual reason usb_driver_claim_interface > > calls klist_node_attached is to avoid calling device_bind_driver for a > > device that hasn't been registered yet. It's not meant for avoiding > > double binds (and in fact it won't prevent them). > > > > but nonetheless it does avoid a double bind.
Not through any virtue of usb_driver_claim_interface. Double-binding is avoided by the callers; they are smart enough not to claim an interface that they are already bound to. > > > > Have I missed something here? Since when has the .driver member been > > > > removed from usb_interface? > > > > > > > > > > 18 months ago. see: > > > http://linux.bkbits.net:8080/linux-2.6/diffs/drivers/usb/core/usb.c%401.157?nav=index.html|src/.|src/drivers|src/drivers/usb|src/drivers/usb/core|hist/drivers/usb/core/usb.c > > > > That patch didn't remove any fields from any structures. > > > > well, it's the patch removing the usage of the field. the definition is of > course > in the header file. but since i didn't find a link in bkweb to go from a file > change to the whole changeset.... > anyway here goes the header file change: > http://linux.bkbits.net:8080/linux-2.6/diffs/include/linux/usb.h%401.102?nav=index.html|src/|src/include|src/include/linux|hist/include/linux/usb.h Okay, now I understand what you were talking about. The .driver field was removed because it was redundant; it contained essentially the same information as .dev.driver. > i like that one. something like the attached one and i shut up... Your patch looks good to me. Go ahead and submit it to Greg KH. You might want to include these changes as well: Index: usb-2.6/drivers/s390/cio/ccwgroup.c =================================================================== --- usb-2.6.orig/drivers/s390/cio/ccwgroup.c +++ usb-2.6/drivers/s390/cio/ccwgroup.c @@ -437,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_d if (cdev->dev.driver_data) { gdev = (struct ccwgroup_device *)cdev->dev.driver_data; if (get_device(&gdev->dev)) { - if (klist_node_attached(&gdev->dev.knode_bus)) + if (device_is_registered(&gdev->dev)) return gdev; put_device(&gdev->dev); } Index: usb-2.6/drivers/usb/core/message.c =================================================================== --- usb-2.6.orig/drivers/usb/core/message.c +++ usb-2.6/drivers/usb/core/message.c @@ -985,7 +985,7 @@ void usb_disable_device(struct usb_devic /* remove this interface if it has been registered */ interface = dev->actconfig->interface[i]; - if (!klist_node_attached(&interface->dev.knode_bus)) + if (!device_is_registered(&interface->dev)) continue; dev_dbg (&dev->dev, "unregistering interface %s\n", interface->dev.bus_id); Index: usb-2.6/drivers/usb/core/usb.c =================================================================== --- usb-2.6.orig/drivers/usb/core/usb.c +++ usb-2.6/drivers/usb/core/usb.c @@ -326,8 +326,8 @@ void usb_driver_release_interface(struct if (iface->condition != USB_INTERFACE_BOUND) return; - /* release only after device_add() */ - if (klist_node_attached(&dev->knode_bus)) { + /* don't release if the interface hasn't been added yet */ + if (device_is_registered(dev)) { iface->condition = USB_INTERFACE_UNBINDING; device_release_driver(dev); } Alan Stern ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel