aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/sysfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 2ea47a38aefa..e7c982377488 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -118,6 +118,16 @@ show_speed(struct device *dev, struct device_attribute *attr, char *buf)
118static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL); 118static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL);
119 119
120static ssize_t 120static ssize_t
121show_busnum(struct device *dev, struct device_attribute *attr, char *buf)
122{
123 struct usb_device *udev;
124
125 udev = to_usb_device(dev);
126 return sprintf(buf, "%d\n", udev->bus->busnum);
127}
128static DEVICE_ATTR(busnum, S_IRUGO, show_busnum, NULL);
129
130static ssize_t
121show_devnum(struct device *dev, struct device_attribute *attr, char *buf) 131show_devnum(struct device *dev, struct device_attribute *attr, char *buf)
122{ 132{
123 struct usb_device *udev; 133 struct usb_device *udev;
@@ -347,6 +357,7 @@ static struct attribute *dev_attrs[] = {
347 &dev_attr_bNumConfigurations.attr, 357 &dev_attr_bNumConfigurations.attr,
348 &dev_attr_bMaxPacketSize0.attr, 358 &dev_attr_bMaxPacketSize0.attr,
349 &dev_attr_speed.attr, 359 &dev_attr_speed.attr,
360 &dev_attr_busnum.attr,
350 &dev_attr_devnum.attr, 361 &dev_attr_devnum.attr,
351 &dev_attr_version.attr, 362 &dev_attr_version.attr,
352 &dev_attr_maxchild.attr, 363 &dev_attr_maxchild.attr,