aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2009-12-03 12:44:34 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:27 -0500
commit91017f9cf5fcfb601b8d583c896ac7de7d200c57 (patch)
treeca601c606ded366e14df0ac019ecd4c43c5b11d9 /include/linux/usb.h
parent06df572909080786e128eabdb2e39a12bce239de (diff)
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>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 6af3581e1114..e101a2d04d75 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -619,6 +619,10 @@ extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,
619 unsigned ifnum); 619 unsigned ifnum);
620extern struct usb_host_interface *usb_altnum_to_altsetting( 620extern struct usb_host_interface *usb_altnum_to_altsetting(
621 const struct usb_interface *intf, unsigned int altnum); 621 const struct usb_interface *intf, unsigned int altnum);
622extern struct usb_host_interface *usb_find_alt_setting(
623 struct usb_host_config *config,
624 unsigned int iface_num,
625 unsigned int alt_num);
622 626
623 627
624/** 628/**