From: Alan Stern Date: Thu, 6 Jul 2006 19:37:42 +0000 (-0400) Subject: usbcore: add configuration_string to attribute group X-Git-Tag: v2.6.19-rc1~899^2~114 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6eb2d84d2bb01e9fcc46a032a3429b4747b1c47;p=linux-2.6 usbcore: add configuration_string to attribute group 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). Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index dec973affb..cd2286246f 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -60,7 +60,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) @@ -186,6 +186,7 @@ usb_descriptor_attr (bMaxPacketSize0, "%d\n") 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, @@ -221,7 +222,6 @@ void usb_create_sysfs_dev_files (struct usb_device *udev) 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); } @@ -238,7 +238,6 @@ void usb_remove_sysfs_dev_files (struct usb_device *udev) 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 */