Greg:

This patch (as737b) does a very small cleanup of core/sysfs.c by adding
the configuration_string attribute file to the existing attribute group
instead of treating it separately.  It doesn't need this separate
treatment because unlike the other device string attributes, it changes
along with the active configuration.

The patch also fixes a simple typo (which, oddly enough, doesn't seem to 
bother the compiler).

Alan Stern



Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

---

Index: usb-2.6/drivers/usb/core/sysfs.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/sysfs.c
+++ usb-2.6/drivers/usb/core/sysfs.c
@@ -61,7 +61,7 @@ static ssize_t
 set_bConfigurationValue (struct device *dev, struct device_attribute *attr,
                const char *buf, size_t count)
 {
-       struct usb_device       *udev = udev = to_usb_device (dev);
+       struct usb_device       *udev = to_usb_device (dev);
        int                     config, value;
 
        if (sscanf (buf, "%u", &config) != 1 || config > 255)
@@ -187,6 +187,7 @@ usb_descriptor_attr (bMaxPacketSize0, "%
 
 static struct attribute *dev_attrs[] = {
        /* current configuration's attributes */
+       &dev_attr_configuration.attr,
        &dev_attr_bNumInterfaces.attr,
        &dev_attr_bConfigurationValue.attr,
        &dev_attr_bmAttributes.attr,
@@ -222,7 +223,6 @@ void usb_create_sysfs_dev_files (struct 
                device_create_file (dev, &dev_attr_product);
        if (udev->serial)
                device_create_file (dev, &dev_attr_serial);
-       device_create_file (dev, &dev_attr_configuration);
        usb_create_ep_files(dev, &udev->ep0, udev);
 }
 
@@ -239,7 +239,6 @@ void usb_remove_sysfs_dev_files (struct 
                device_remove_file(dev, &dev_attr_product);
        if (udev->serial)
                device_remove_file(dev, &dev_attr_serial);
-       device_remove_file (dev, &dev_attr_configuration);
 }
 
 /* Interface fields */


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to