Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316968
b: refs/heads/master
c: 6f17f74
h: refs/heads/master
v: v3
  • Loading branch information
Pratyush Anand authored and Felipe Balbi committed Jul 2, 2012
1 parent 8334100 commit 7483237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: e274a31e29b6a097c32f526493f4ebce10856dcb
refs/heads/master: 6f17f74b3d8345663f5fcfd834145685110075bd
11 changes: 7 additions & 4 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ static int dwc3_gadget_set_selfpowered(struct usb_gadget *g,
return 0;
}

static void dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on)
static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on)
{
u32 reg;
u32 timeout = 500;
Expand Down Expand Up @@ -1440,28 +1440,31 @@ static void dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on)
}
timeout--;
if (!timeout)
break;
return -ETIMEDOUT;
udelay(1);
} while (1);

dev_vdbg(dwc->dev, "gadget %s data soft-%s\n",
dwc->gadget_driver
? dwc->gadget_driver->function : "no-function",
is_on ? "connect" : "disconnect");

return 0;
}

static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
{
struct dwc3 *dwc = gadget_to_dwc(g);
unsigned long flags;
int ret;

is_on = !!is_on;

spin_lock_irqsave(&dwc->lock, flags);
dwc3_gadget_run_stop(dwc, is_on);
ret = dwc3_gadget_run_stop(dwc, is_on);
spin_unlock_irqrestore(&dwc->lock, flags);

return 0;
return ret;
}

static int dwc3_gadget_start(struct usb_gadget *g,
Expand Down

0 comments on commit 7483237

Please sign in to comment.