Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22084
b: refs/heads/master
c: f48219d
h: refs/heads/master
v: v3
  • Loading branch information
Horst Schirmeier authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 2343e06 commit ef6d88e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 6aa35675bbc370e5f11baae7e01a9ab255d8030c
refs/heads/master: f48219db93eaee644e9fd9f22fb6421f38059cc5
12 changes: 7 additions & 5 deletions trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,11 +1388,13 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
if (dev->state != USB_STATE_ADDRESS)
usb_disable_device (dev, 1); // Skip ep0

i = dev->bus_mA - cp->desc.bMaxPower * 2;
if (i < 0)
dev_warn(&dev->dev, "new config #%d exceeds power "
"limit by %dmA\n",
configuration, -i);
if (cp) {
i = dev->bus_mA - cp->desc.bMaxPower * 2;
if (i < 0)
dev_warn(&dev->dev, "new config #%d exceeds power "
"limit by %dmA\n",
configuration, -i);
}

if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
Expand Down

0 comments on commit ef6d88e

Please sign in to comment.