aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/sysfs.c
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2012-05-18 15:27:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-13 18:40:09 -0400
commit81df2d594340dcb6d1a02191976be88a1ca8120c (patch)
treef5a20ebf416c03b41611518d54706019d0c0ffa2 /drivers/usb/core/sysfs.c
parent7e97243c2080ecae7129e83635227fdebd4feef6 (diff)
USB: allow match on bInterfaceNumber
Some composite USB devices provide multiple interfaces with different functions, all using "vendor-specific" for class/subclass/protocol. Another OS use interface numbers to match the driver and interface. It seems these devices are designed with that in mind - using static interface numbers for the different functions. This adds support for matching against the bInterfaceNumber, allowing such devices to be supported without having to resort to testing against interface number whitelists and/or blacklists in the probe. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r--drivers/usb/core/sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 9a56e3adf476..777f03c37725 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -840,7 +840,7 @@ static ssize_t show_modalias(struct device *dev,
840 alt = intf->cur_altsetting; 840 alt = intf->cur_altsetting;
841 841
842 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02X" 842 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02X"
843 "ic%02Xisc%02Xip%02X\n", 843 "ic%02Xisc%02Xip%02Xin%02X\n",
844 le16_to_cpu(udev->descriptor.idVendor), 844 le16_to_cpu(udev->descriptor.idVendor),
845 le16_to_cpu(udev->descriptor.idProduct), 845 le16_to_cpu(udev->descriptor.idProduct),
846 le16_to_cpu(udev->descriptor.bcdDevice), 846 le16_to_cpu(udev->descriptor.bcdDevice),
@@ -849,7 +849,8 @@ static ssize_t show_modalias(struct device *dev,
849 udev->descriptor.bDeviceProtocol, 849 udev->descriptor.bDeviceProtocol,
850 alt->desc.bInterfaceClass, 850 alt->desc.bInterfaceClass,
851 alt->desc.bInterfaceSubClass, 851 alt->desc.bInterfaceSubClass,
852 alt->desc.bInterfaceProtocol); 852 alt->desc.bInterfaceProtocol,
853 alt->desc.bInterfaceNumber);
853} 854}
854static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); 855static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL);
855 856