Right.
It's not a big deal to remove the files first. In fact, here's a patch
to do it. Dave, see if this doesn't fix your problem. I don't like it
much because it does an unnecessary remove/create cycle, but that's
better than doing something wrong.
It's slightly odd that the sysfs core logs an error when you try to
create the same file twice but it doesn't when you try to remove a
non-existent file (or try to remove an existing file twice). Oh
well...
Alan Stern
Index: usb-2.6/drivers/usb/core/message.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/message.c
+++ usb-2.6/drivers/usb/core/message.c
@@ -1643,7 +1643,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);
-