Skip to content

Commit

Permalink
usb: gadget: fotg210-udc: remove duplicate conditions
Browse files Browse the repository at this point in the history
We handle the "if (!req->req.length)" condition at the start of the
function and return.  We can delete this dead code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed Jul 30, 2015
1 parent 6f98f54 commit 1c99cab
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions drivers/usb/gadget/udc/fotg210-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,25 +384,15 @@ static void fotg210_ep0_queue(struct fotg210_ep *ep,
return;
}
if (ep->dir_in) { /* if IN */
if (req->req.length) {
fotg210_start_dma(ep, req);
} else {
pr_err("%s : req->req.length = 0x%x\n",
__func__, req->req.length);
}
fotg210_start_dma(ep, req);
if ((req->req.length == req->req.actual) ||
(req->req.actual < ep->ep.maxpacket))
fotg210_done(ep, req, 0);
} else { /* OUT */
if (!req->req.length) {
fotg210_done(ep, req, 0);
} else {
u32 value = ioread32(ep->fotg210->reg +
FOTG210_DMISGR0);
u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0);

value &= ~DMISGR0_MCX_OUT_INT;
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR0);
}
value &= ~DMISGR0_MCX_OUT_INT;
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR0);
}
}

Expand Down

0 comments on commit 1c99cab

Please sign in to comment.