> Well, the device's kobject's name is set in
> drivers/base/core.c:device_add() by this line of code:
>
>       kobject_set_name(&dev->kobj,dev->bus_id);
>
> device_add(), in turn, is called by usb_set_configuration (or maybe in
> your version of the code it's device_register(), which calls
> device_add()).
>
> That just pushes the problem back to where intf->dev->bus_id is set.  It's
> also set in usb_set_configuration(), although there's no reason it
> couldn't be done earlier in config.c.

Thanks a lot.  This is extremely problematic then: in usb_set_configuration,
an interface's device structure will not be completely initialized until we do
        device_add (&intf->dev);
However device_add does probe(), which can claim other interfaces.  These
interfaces may have uninitialized device structures because device_add has
not been called for them yet.  I want usb_driver_claim_interface to call
device_bind_driver.  But the above means that device_bind_driver may be
called with an uninitialized device structure (in practice, it is the NULL name
field that causes problems).  It is a catch 22: if you initialize the interface with
device_add then you need to have already initialized all other interfaces with
device_add and that's not possible (unless there is only one interface).
What to do?

Duncan.


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to