]> git.baikalelectronics.ru Git - kernel.git/commit
USB: Refactor code to find alternate interface settings.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 3 Dec 2009 17:44:34 +0000 (09:44 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 19:55:27 +0000 (11:55 -0800)
commit7e0a859b0489558087e32e2d333e0759944afdd9
treeca601c606ded366e14df0ac019ecd4c43c5b11d9
parent21eacefa7a6294cc1b5d6295abe2ddc5bd96a568
USB: Refactor code to find alternate interface settings.

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 configuration's 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@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hcd.c
drivers/usb/core/usb.c
include/linux/usb.h