Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83f7d958eab2fbc6b159ee92bf1493924e1d0f72
Commit:     83f7d958eab2fbc6b159ee92bf1493924e1d0f72
Parent:     6a02c996bce297a782432e29c69268356e97fadd
Author:     Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 25 15:15:43 2007 -0400
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:28:42 2007 -0700

    USB: add "busnum" attribute for USB devices
    
    This patch (as903) adds a "busnum" sysfs attribute for USB devices.
    
    Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/sysfs.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 2ea47a3..e7c9823 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)
 static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL);
 
 static ssize_t
+show_busnum(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       struct usb_device *udev;
+
+       udev = to_usb_device(dev);
+       return sprintf(buf, "%d\n", udev->bus->busnum);
+}
+static DEVICE_ATTR(busnum, S_IRUGO, show_busnum, NULL);
+
+static ssize_t
 show_devnum(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct usb_device *udev;
@@ -347,6 +357,7 @@ static struct attribute *dev_attrs[] = {
        &dev_attr_bNumConfigurations.attr,
        &dev_attr_bMaxPacketSize0.attr,
        &dev_attr_speed.attr,
+       &dev_attr_busnum.attr,
        &dev_attr_devnum.attr,
        &dev_attr_version.attr,
        &dev_attr_maxchild.attr,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to