Re: [linux-usb-devel] 2.6.6-rc1: cdc-acm still (differently) broken

From: Alan Stern
Date: Thu Apr 15 2004 - 15:27:17 EST


On Thu, 15 Apr 2004, Colin Leroy wrote:

> Like this one? It works. I'm a bit wondering, however, how comes
> usb_interface_claimed() returns true, and the check in
> usb_driver_claim_interface() passes?

While an interface is being probed, usb_interface_claimed() will always
return true for it. That's because the probing code sets
interface->dev.driver (which is what usb_interface_claimed() tests) before
calling the probe function. If the probe fails then interface->dev.driver
will be reset. This all happens inside bus_match() in drivers/base/bus.c.

For the same reason, the test of (dev->driver) in
usb_driver_claim_interface() -- that is the test you meant, isn't it? --
passes (i.e., yields a true value).

Alan Stern

-
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/