usb: dwc3: gadget: no need to pass params in case of UPDATE_TRANSFER
authorPratyush Anand <pratyush.anand@st.com>
Mon, 14 Jan 2013 10:29:36 +0000 (15:59 +0530)
committerFelipe Balbi <balbi@ti.com>
Fri, 18 Jan 2013 12:31:07 +0000 (14:31 +0200)
UPDATE_TRANSFER does not need any parameters. So, no need to prepare it.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c

index da8d57cb00e8108a9289fb9acc515dd1b1800e2d..686c31c3d87ce4cd0e7eed02dcbf31aa118c543b 100644 (file)
@@ -974,13 +974,14 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param,
        }
 
        memset(&params, 0, sizeof(params));
-       params.param0 = upper_32_bits(req->trb_dma);
-       params.param1 = lower_32_bits(req->trb_dma);
 
-       if (start_new)
+       if (start_new) {
+               params.param0 = upper_32_bits(req->trb_dma);
+               params.param1 = lower_32_bits(req->trb_dma);
                cmd = DWC3_DEPCMD_STARTTRANSFER;
-       else
+       } else {
                cmd = DWC3_DEPCMD_UPDATETRANSFER;
+       }
 
        cmd |= DWC3_DEPCMD_PARAM(cmd_param);
        ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);