Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67831
b: refs/heads/master
c: d74d4a6
h: refs/heads/master
i:
  67829: e5fce60
  67827: da9aedf
  67823: ba3cfbb
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent 80d54ff commit b804c57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9df41c5c5899259541dc928872cad4d07b82076
refs/heads/master: d74d4a69dc1cc7ddc0eabb9c9f1e45005e2984eb
6 changes: 4 additions & 2 deletions trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
struct usb_host_interface *alt;
int ret;
int manual = 0;
int changed;

if (dev->state == USB_STATE_SUSPENDED)
return -EHOSTUNREACH;
Expand Down Expand Up @@ -1212,7 +1213,8 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
*/

/* prevent submissions using previous endpoint settings */
if (device_is_registered(&iface->dev))
changed = (iface->cur_altsetting != alt);
if (changed && device_is_registered(&iface->dev))
usb_remove_sysfs_intf_files(iface);
usb_disable_interface(dev, iface);

Expand Down Expand Up @@ -1249,7 +1251,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
* (Likewise, EP0 never "halts" on well designed devices.)
*/
usb_enable_interface(dev, iface);
if (device_is_registered(&iface->dev))
if (changed && device_is_registered(&iface->dev))
usb_create_sysfs_intf_files(iface);

return 0;
Expand Down

0 comments on commit b804c57

Please sign in to comment.