On Wed, 2 Dec 2009, Sarah Sharp wrote: > Refactor out the code to find alternate interface settings into > usb_find_alt_setting(). Print a debugging message and return null if the > alt setting is not found. > > While we're at it, correct a bug in the refactored code. The interfaces > in the configurations' interface cache are not necessarily in numerical > order, so we can't just use the interface number as an array index. Loop > through the interface caches, looking for the correct interface. > > Signed-off-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx> > --- > > Alan, > > I could not find a way to use usb_altnum_to_altsetting(). It takes a > struct usb_interface as an argument, but the second for loop is looking > through the interface cache, which contains struct usb_host_interfaces. > > I need to use the interface cache, since this function may be used when > installing a new configuration (when usb_host_config->interface[] is not > valid). Yes, you're right. I should have realized this. The patch looks good. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html