Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1814
b: refs/heads/master
c: 77ddecc
h: refs/heads/master
v: v3
  • Loading branch information
Paulo Marques authored and Greg KH committed Jun 3, 2005
1 parent 612d4b8 commit dd7b31c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58cfe9113e485f7e04bd0eac4fc4251b330af501
refs/heads/master: 77ddecc3c047e4e9bd7332d3173def93ea2de1ad
22 changes: 10 additions & 12 deletions trunk/drivers/usb/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,32 +290,30 @@ static ssize_t show_modalias(struct device *dev, char *buf)
{
struct usb_interface *intf;
struct usb_device *udev;
int len;

intf = to_usb_interface(dev);
udev = interface_to_usbdev(intf);
if (udev->descriptor.bDeviceClass == 0) {
struct usb_host_interface *alt = intf->cur_altsetting;

return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X\n",
len = sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic",
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct),
le16_to_cpu(udev->descriptor.bcdDevice),
udev->descriptor.bDeviceClass,
udev->descriptor.bDeviceSubClass,
udev->descriptor.bDeviceProtocol,
udev->descriptor.bDeviceProtocol);
buf += len;

if (udev->descriptor.bDeviceClass == 0) {
struct usb_host_interface *alt = intf->cur_altsetting;

return len + sprintf(buf, "%02Xisc%02Xip%02X\n",
alt->desc.bInterfaceClass,
alt->desc.bInterfaceSubClass,
alt->desc.bInterfaceProtocol);
} else {
return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*\n",
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct),
le16_to_cpu(udev->descriptor.bcdDevice),
udev->descriptor.bDeviceClass,
udev->descriptor.bDeviceSubClass,
udev->descriptor.bDeviceProtocol);
return len + sprintf(buf, "*isc*ip*\n");
}

}
static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL);

Expand Down

0 comments on commit dd7b31c

Please sign in to comment.