On Thu, 14 Oct 2010, Jurgen Braam wrote: > Hi, > > > On the other hand, clear_tt_buffer_complete is never called if the > > driver isn't EHCI. Consequently there's no real need for a NULL check. > > If you send in a patch removing that check, I'll ACK it. (Provided you > > also doublecheck all the other in-tree drivers to make sure the pointer > > entry is present.) > > Possibly something like usb-serial.c's set_to_generic_if_null() could be > used here when (type == EHCI) to prevent future omissions: > > #define set_to_generic_if_null(type, function) \ > do { \ > if (!type->function) { \ > type->function = usb_serial_generic_##function; \ > dbg("Had to override the " #function \ > " usb serial operation with the generic one.");\ > } \ > } while (0) > > But then in this case perhaps a dev_err() would be more appropriate? > > The omission of clear_tt_buffer_complete and endpoint_reset resulted in > usb-serial devices like ftdi_sio only working correctly the first time > they were being opened. More info in my msg "[PATCH][RFC] USB: EHCI: add > missing {endpoint_reset,clear_tt_buffer_complete} operations" posted > earlier. If you can figure out how to make this work, go ahead. Bear in mind that usbcore isn't allowed to modify the contents of an hc_driver structure, since it is declared "const". Also bear in mind that usbcore can't contain any pointers to ehci_clear_tt_buffer_complete, since that function belongs to a lower-level module. Finally, remember that there is no reliable way for usbcore to tell whether or not a particular host controller driver is an EHCI driver. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html