Skip to content

Commit ab4dc05

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: mtu3: simplify mtu3_req_complete()
Use argument req directly instead of mreq->request, they are the same usb request. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f1e51e9 commit ab4dc05

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

drivers/usb/mtu3/mtu3_gadget.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,24 @@ void mtu3_req_complete(struct mtu3_ep *mep,
1515
__releases(mep->mtu->lock)
1616
__acquires(mep->mtu->lock)
1717
{
18-
struct mtu3_request *mreq;
19-
struct mtu3 *mtu;
18+
struct mtu3_request *mreq = to_mtu3_request(req);
19+
struct mtu3 *mtu = mreq->mtu;
2020

21-
mreq = to_mtu3_request(req);
2221
list_del(&mreq->list);
23-
if (mreq->request.status == -EINPROGRESS)
24-
mreq->request.status = status;
22+
if (req->status == -EINPROGRESS)
23+
req->status = status;
2524

26-
mtu = mreq->mtu;
2725
trace_mtu3_req_complete(mreq);
2826
spin_unlock(&mtu->lock);
2927

3028
/* ep0 makes use of PIO, needn't unmap it */
3129
if (mep->epnum)
3230
usb_gadget_unmap_request(&mtu->g, req, mep->is_in);
3331

34-
dev_dbg(mtu->dev, "%s complete req: %p, sts %d, %d/%d\n", mep->name,
35-
req, req->status, mreq->request.actual, mreq->request.length);
36-
37-
usb_gadget_giveback_request(&mep->ep, &mreq->request);
32+
dev_dbg(mtu->dev, "%s complete req: %p, sts %d, %d/%d\n",
33+
mep->name, req, req->status, req->actual, req->length);
3834

35+
usb_gadget_giveback_request(&mep->ep, req);
3936
spin_lock(&mtu->lock);
4037
}
4138

0 commit comments

Comments
 (0)