Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10831
b: refs/heads/master
c: 0e6c8e8
h: refs/heads/master
i:
  10829: 6bf500e
  10827: 6a43a51
  10823: c70fd78
  10815: 9498aaf
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent f34b7b0 commit 5eac464
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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: be69e5b1900a19a545becda822b18d6f09168ba5
refs/heads/master: 0e6c8e8db508fcb292836b23d039649c5de29090
12 changes: 9 additions & 3 deletions trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,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))
usb_remove_sysfs_intf_files(iface);
usb_disable_interface(dev, iface);

iface->cur_altsetting = alt;
Expand Down Expand Up @@ -1184,6 +1186,8 @@ 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))
usb_create_sysfs_intf_files(iface);

return 0;
}
Expand Down Expand Up @@ -1233,10 +1237,8 @@ int usb_reset_configuration(struct usb_device *dev)
USB_REQ_SET_CONFIGURATION, 0,
config->desc.bConfigurationValue, 0,
NULL, 0, USB_CTRL_SET_TIMEOUT);
if (retval < 0) {
usb_set_device_state(dev, USB_STATE_ADDRESS);
if (retval < 0)
return retval;
}

dev->toggle[0] = dev->toggle[1] = 0;

Expand All @@ -1245,6 +1247,8 @@ int usb_reset_configuration(struct usb_device *dev)
struct usb_interface *intf = config->interface[i];
struct usb_host_interface *alt;

if (device_is_registered(&intf->dev))
usb_remove_sysfs_intf_files(intf);
alt = usb_altnum_to_altsetting(intf, 0);

/* No altsetting 0? We'll assume the first altsetting.
Expand All @@ -1257,6 +1261,8 @@ int usb_reset_configuration(struct usb_device *dev)

intf->cur_altsetting = alt;
usb_enable_interface(dev, intf);
if (device_is_registered(&intf->dev))
usb_create_sysfs_intf_files(intf);
}
return 0;
}
Expand Down

0 comments on commit 5eac464

Please sign in to comment.