Skip to content

Commit 1c99cab

Browse files
Dan CarpenterFelipe Balbi
authored andcommitted
usb: gadget: fotg210-udc: remove duplicate conditions
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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 6f98f54 commit 1c99cab

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

drivers/usb/gadget/udc/fotg210-udc.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -384,25 +384,15 @@ static void fotg210_ep0_queue(struct fotg210_ep *ep,
384384
return;
385385
}
386386
if (ep->dir_in) { /* if IN */
387-
if (req->req.length) {
388-
fotg210_start_dma(ep, req);
389-
} else {
390-
pr_err("%s : req->req.length = 0x%x\n",
391-
__func__, req->req.length);
392-
}
387+
fotg210_start_dma(ep, req);
393388
if ((req->req.length == req->req.actual) ||
394389
(req->req.actual < ep->ep.maxpacket))
395390
fotg210_done(ep, req, 0);
396391
} else { /* OUT */
397-
if (!req->req.length) {
398-
fotg210_done(ep, req, 0);
399-
} else {
400-
u32 value = ioread32(ep->fotg210->reg +
401-
FOTG210_DMISGR0);
392+
u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0);
402393

403-
value &= ~DMISGR0_MCX_OUT_INT;
404-
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR0);
405-
}
394+
value &= ~DMISGR0_MCX_OUT_INT;
395+
iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR0);
406396
}
407397
}
408398

0 commit comments

Comments
 (0)