Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=439a903a9663c0caa8094f3907ca60069d6c36e7
Commit: 439a903a9663c0caa8094f3907ca60069d6c36e7
Parent: b22817b3c81cdb18ffe3d2debfee968731a8b5f4
Author: Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 09:51:58 2007 -0400
Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Oct 25 12:18:44 2007 -0700
USB: fix interface sysfs file-creation bug
This patch (as1005) fixes a rather subtle problem. When
usb_set_configuration() registers the interfaces and their files in
sysfs, it doesn't expect those files to exist already. But when an
interface is registered, its driver may call usb_set_interface() and
thereby cause the sysfs files to be created. The result is an error
when usb_set_configuration() goes on to create those same files again.
The (not-so-great) solution is to have usb_set_configuration() remove
any existing files before creating them.
Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
drivers/usb/core/message.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 8bdaa15..eb4ac47 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1641,7 +1641,13 @@ free_interfaces:
intf->dev.bus_id, ret);
continue;
}
- usb_create_sysfs_intf_files (intf);
+
+ /* The driver's probe method can call usb_set_interface(),
+ * which would mean the interface's sysfs files are already
+ * created. Just in case, we'll remove them first.
+ */
+ usb_remove_sysfs_intf_files(intf);
+ usb_create_sysfs_intf_files(intf);
}
usb_autosuspend_device(dev);
-
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