[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1595834101-13094-11-git-send-email-chunfeng.yun@mediatek.com>
Date: Mon, 27 Jul 2020 15:15:00 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Matthias Brugger <matthias.bgg@...il.com>,
Chunfeng Yun <chunfeng.yun@...iatek.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Eddie Hung <eddie.hung@...iatek.com>
Subject: [PATCH 11/11] 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 <chunfeng.yun@...iatek.com>
---
drivers/usb/mtu3/mtu3_gadget.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c
index 73a8536..1de5c9a 100644
--- a/drivers/usb/mtu3/mtu3_gadget.c
+++ b/drivers/usb/mtu3/mtu3_gadget.c
@@ -15,15 +15,13 @@ void mtu3_req_complete(struct mtu3_ep *mep,
__releases(mep->mtu->lock)
__acquires(mep->mtu->lock)
{
- struct mtu3_request *mreq;
- struct mtu3 *mtu;
+ struct mtu3_request *mreq = to_mtu3_request(req);
+ struct mtu3 *mtu = mreq->mtu;
- mreq = to_mtu3_request(req);
list_del(&mreq->list);
- if (mreq->request.status == -EINPROGRESS)
- mreq->request.status = status;
+ if (req->status == -EINPROGRESS)
+ req->status = status;
- mtu = mreq->mtu;
trace_mtu3_req_complete(mreq);
spin_unlock(&mtu->lock);
@@ -31,11 +29,10 @@ void mtu3_req_complete(struct mtu3_ep *mep,
if (mep->epnum)
usb_gadget_unmap_request(&mtu->g, req, mep->is_in);
- dev_dbg(mtu->dev, "%s complete req: %p, sts %d, %d/%d\n", mep->name,
- req, req->status, mreq->request.actual, mreq->request.length);
-
- usb_gadget_giveback_request(&mep->ep, &mreq->request);
+ dev_dbg(mtu->dev, "%s complete req: %p, sts %d, %d/%d\n",
+ mep->name, req, req->status, req->actual, req->length);
+ usb_gadget_giveback_request(&mep->ep, req);
spin_lock(&mtu->lock);
}
--
1.9.1
Powered by blists - more mailing lists