[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [linux-usb-devel] [patch, attach, RFC] usb-serial: ti_usb removing firmware



> Mister Greg, how to change configuration _inside_ the driver? Device
> was made to be
> working on second usb config after one reconnect/device change, i've
> lost whole day
> trying to make something with that. After all, usb_set_configuration()
> isn't even
> EXPORT()ED at all !

It isn't exported because, generally speaking, drivers can't use it.  If
your driver called usb_set_configuration() from within its probe routine,
it would hang.  That's because usb_set_configuration would unregister the
interface being probed by your driver, so it would try to call your
driver's disconnect routine, but first it would have to wait for the probe
to finish -- deadlock.

There is an exported routine drivers can use in the rare cases where they 
do need to change configurations.  It's called 
usb_driver_set_configuration(), and it is present in 2.6.19.

Alan Stern



Reply to: