summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-02-10 22:00:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-13 11:53:09 +0100
commitb043601a35120c394d67fd47ebd37854b0472e60 (patch)
tree9b6dd978787ef480f843120211cadfdc5e03c28d /drivers
parent688db6972d515d8ed5aaca2631df9145102fc421 (diff)
downloadbarebox-b043601a35120c394d67fd47ebd37854b0472e60.tar.gz
barebox-b043601a35120c394d67fd47ebd37854b0472e60.tar.xz
usb: gadget: fsl_udc: remove unnessary argument
fsl_build_dtd() returns the length of the dTD, but it is never used. Remove the length argument from the function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/fsl_udc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c
index a44c7abc01..c7160cdbc7 100644
--- a/drivers/usb/gadget/fsl_udc.c
+++ b/drivers/usb/gadget/fsl_udc.c
@@ -1128,18 +1128,18 @@ out:
/* Fill in the dTD structure
* @req: request that the transfer belongs to
- * @length: return actually data length of the dTD
* @dma: return dma address of the dTD
* @is_last: return flag if it is the last dTD of the request
* return: pointer to the built dTD */
-static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
+static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req,
dma_addr_t *dma, int *is_last)
{
+ unsigned length;
u32 swap_temp;
struct ep_td_struct *dtd;
/* how big will this transfer be? */
- *length = min(req->req.length - req->req.actual,
+ length = min(req->req.length - req->req.actual,
(unsigned)EP_MAX_LENGTH_TRANSFER);
dtd = dma_alloc_coherent(sizeof(struct ep_td_struct),
@@ -1161,11 +1161,11 @@ static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
dtd->buff_ptr3 = cpu_to_le32(swap_temp + 0x3000);
dtd->buff_ptr4 = cpu_to_le32(swap_temp + 0x4000);
- req->req.actual += *length;
+ req->req.actual += length;
/* zlp is needed if req->req.zero is set */
if (req->req.zero) {
- if (*length == 0 || (*length % req->ep->ep.maxpacket) != 0)
+ if (length == 0 || (length % req->ep->ep.maxpacket) != 0)
*is_last = 1;
else
*is_last = 0;
@@ -1177,7 +1177,7 @@ static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
if ((*is_last) == 0)
VDBG("multi-dtd request!");
/* Fill in the transfer size; set active bit */
- swap_temp = ((*length << DTD_LENGTH_BIT_POS) | DTD_STATUS_ACTIVE);
+ swap_temp = ((length << DTD_LENGTH_BIT_POS) | DTD_STATUS_ACTIVE);
/* Enable interrupt for the last dtd of a request */
if (*is_last && !req->req.no_interrupt)
@@ -1193,14 +1193,13 @@ static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
/* Generate dtd chain for a request */
static int fsl_req_to_dtd(struct fsl_req *req)
{
- unsigned count;
int is_last;
int is_first =1;
struct ep_td_struct *last_dtd = NULL, *dtd;
dma_addr_t dma;
do {
- dtd = fsl_build_dtd(req, &count, &dma, &is_last);
+ dtd = fsl_build_dtd(req, &dma, &is_last);
if (dtd == NULL)
return -ENOMEM;