speedtch testatm.c,1.4,1.5
Duncan Sands
baldrick at free.fr
Fri Apr 8 08:18:42 EDT 2005
Hi Roman,
> Then it looks like you need to usb_set_intfdata(intf, NULL) _before_
> releasing that intf, to avoid repeating the same thing in its
> disconnect(). Anyway recursing into the disconnect for the same
> interface still sounds like a bad thing, and IMHO should be avoided by
> not releasing it its own disconnect(). Or was I wrong im my analysis?
I already set it to NULL for just this reason - check the code. And you
don't recurse into disconnect for the interface disconnect was called
on: the usb_driver_release_interface code ignores the release in this
case. Let me summarize:
(1) I set the interface data to the usbatm_data for all interfaces.
That way, a disconnect on any one of them will cause unbind to be
called.
(2) it would be fatal to get multiple calls to usbatm_usb_disconnect
with the same usbatm_data, so I set the interface data to NULL before
releasing each interface. This avoids both recursion and corruption.
Ciao,
Duncan.
More information about the Usbatm
mailing list