diff options
Diffstat (limited to 'drivers/usb/core/sysfs.c')
-rw-r--r-- | drivers/usb/core/sysfs.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index eae413bf8c2a..4bdbc9df6e03 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -462,30 +462,23 @@ static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, | |||
462 | { | 462 | { |
463 | struct usb_interface *intf; | 463 | struct usb_interface *intf; |
464 | struct usb_device *udev; | 464 | struct usb_device *udev; |
465 | int len; | 465 | struct usb_host_interface *alt; |
466 | 466 | ||
467 | intf = to_usb_interface(dev); | 467 | intf = to_usb_interface(dev); |
468 | udev = interface_to_usbdev(intf); | 468 | udev = interface_to_usbdev(intf); |
469 | 469 | alt = intf->cur_altsetting; | |
470 | len = sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic", | 470 | |
471 | le16_to_cpu(udev->descriptor.idVendor), | 471 | return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02X" |
472 | le16_to_cpu(udev->descriptor.idProduct), | 472 | "ic%02Xisc%02Xip%02X\n", |
473 | le16_to_cpu(udev->descriptor.bcdDevice), | 473 | le16_to_cpu(udev->descriptor.idVendor), |
474 | udev->descriptor.bDeviceClass, | 474 | le16_to_cpu(udev->descriptor.idProduct), |
475 | udev->descriptor.bDeviceSubClass, | 475 | le16_to_cpu(udev->descriptor.bcdDevice), |
476 | udev->descriptor.bDeviceProtocol); | 476 | udev->descriptor.bDeviceClass, |
477 | buf += len; | 477 | udev->descriptor.bDeviceSubClass, |
478 | 478 | udev->descriptor.bDeviceProtocol, | |
479 | if (udev->descriptor.bDeviceClass == 0) { | 479 | alt->desc.bInterfaceClass, |
480 | struct usb_host_interface *alt = intf->cur_altsetting; | 480 | alt->desc.bInterfaceSubClass, |
481 | 481 | alt->desc.bInterfaceProtocol); | |
482 | return len + sprintf(buf, "%02Xisc%02Xip%02X\n", | ||
483 | alt->desc.bInterfaceClass, | ||
484 | alt->desc.bInterfaceSubClass, | ||
485 | alt->desc.bInterfaceProtocol); | ||
486 | } else { | ||
487 | return len + sprintf(buf, "*isc*ip*\n"); | ||
488 | } | ||
489 | } | 482 | } |
490 | static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); | 483 | static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); |
491 | 484 | ||