Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280813
b: refs/heads/master
c: f96a6ec
h: refs/heads/master
i:
  280811: 10a6349
v: v3
  • Loading branch information
Felipe Balbi committed Dec 12, 2011
1 parent 4befa80 commit ec77bde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: c4da177f1f5560dfaf2e057cbf85411cd65c5426
refs/heads/master: f96a6ec1db1ac730b5a031f2c2f7fcc6b07459d8
9 changes: 8 additions & 1 deletion trunk/drivers/usb/dwc3/ep0.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,15 @@ static int dwc3_ep0_set_address(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
u32 reg;

addr = le16_to_cpu(ctrl->wValue);
if (addr > 127)
if (addr > 127) {
dev_dbg(dwc->dev, "invalid device address %d\n", addr);
return -EINVAL;
}

if (dwc->dev_state == DWC3_CONFIGURED_STATE) {
dev_dbg(dwc->dev, "trying to set address when configured\n");
return -EINVAL;
}

reg = dwc3_readl(dwc->regs, DWC3_DCFG);
reg &= ~(DWC3_DCFG_DEVADDR_MASK);
Expand Down

0 comments on commit ec77bde

Please sign in to comment.