Commit 9af23624 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarGreg Kroah-Hartman <>
parent be30fc4b
......@@ -138,6 +138,16 @@ show_devnum(struct device *dev, struct device_attribute *attr, char *buf)
static DEVICE_ATTR(devnum, S_IRUGO, show_devnum, NULL);
static ssize_t
show_devpath(struct device *dev, struct device_attribute *attr, char *buf)
struct usb_device *udev;
udev = to_usb_device(dev);
return sprintf(buf, "%s\n", udev->devpath);
static DEVICE_ATTR(devpath, S_IRUGO, show_devpath, NULL);
static ssize_t
show_version(struct device *dev, struct device_attribute *attr, char *buf)
......@@ -538,8 +548,8 @@ static struct attribute *dev_attrs[] = {
/* device attributes */
......@@ -551,6 +561,7 @@ static struct attribute *dev_attrs[] = {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment