aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-11-30 14:15:02 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:25 -0500
commit9af23624ae2c7978313b46e58fdc4ca5d8b799f5 (patch)
tree4720c696b9416c3c0be2df1dc625e7be1bd30659
parentbe30fc4b650acb85549fd0a9c42fe042366de009 (diff)
USB: add devpath sysfs attribute
This is not exported from the usb core, yet we rely on it to create paths to interfaces for this device in sysfs. Export it to make userspace tools have an easier time to figure things out. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/sysfs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 470e2413a9cf..ae763974be25 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -139,6 +139,16 @@ show_devnum(struct device *dev, struct device_attribute *attr, char *buf)
139static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL); 139static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL);
140 140
141static ssize_t 141static ssize_t
142show_devpath(struct device *dev, struct device_attribute *attr, char *buf)
143{
144 struct usb_device *udev;
145
146 udev = to_usb_device(dev);
147 return sprintf(buf, "%s\n", udev->devpath);
148}
149static DEVICE_ATTR(devpath, S_IRUGO, show_devpath, NULL);
150
151static ssize_t
142show_version(struct device *dev, struct device_attribute *attr, char *buf) 152show_version(struct device *dev, struct device_attribute *attr, char *buf)
143{ 153{
144 struct usb_device *udev; 154 struct usb_device *udev;
@@ -538,8 +548,8 @@ static struct attribute *dev_attrs[] = {
538 &dev_attr_bConfigurationValue.attr, 548 &dev_attr_bConfigurationValue.attr,
539 &dev_attr_bmAttributes.attr, 549 &dev_attr_bmAttributes.attr,
540 &dev_attr_bMaxPower.attr, 550 &dev_attr_bMaxPower.attr,
541 &dev_attr_urbnum.attr,
542 /* device attributes */ 551 /* device attributes */
552 &dev_attr_urbnum.attr,
543 &dev_attr_idVendor.attr, 553 &dev_attr_idVendor.attr,
544 &dev_attr_idProduct.attr, 554 &dev_attr_idProduct.attr,
545 &dev_attr_bcdDevice.attr, 555 &dev_attr_bcdDevice.attr,
@@ -551,6 +561,7 @@ static struct attribute *dev_attrs[] = {
551 &dev_attr_speed.attr, 561 &dev_attr_speed.attr,
552 &dev_attr_busnum.attr, 562 &dev_attr_busnum.attr,
553 &dev_attr_devnum.attr, 563 &dev_attr_devnum.attr,
564 &dev_attr_devpath.attr,
554 &dev_attr_version.attr, 565 &dev_attr_version.attr,
555 &dev_attr_maxchild.attr, 566 &dev_attr_maxchild.attr,
556 &dev_attr_quirks.attr, 567 &dev_attr_quirks.attr,