Re: RFC: remove usb_device pointer from usb_skeleton.c

From: Oliver Neukum
Date: Fri Jun 08 2012 - 04:31:17 EST


Am Freitag, 8. Juni 2012, 09:18:55 schrieb Stefani Seibold:
> The connected flag could be also replaced by a "intf->condition ==
> USB_INTERFACE_BOUND", which can be hided by a macro.

No, I am sorry, it cannot. You'd know the interface is bound, but not necessarily
to your driver or even the same "incarnation" of your driver. The fundamental
problem is that we have no data structure describing the binding between a device
and a driver so we cannot refcount that.

As a consequence all refcounting just ensures that the device and interface
data structures stay in memory, but we can make only very limited (read-only)
use of them after a disconnection.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/