mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-13 08:04:45 +08:00
usb: dwc2: Remove unnecessary request length checking
Remove request length checking from dwc2_hsotg_unmap_dma() and dwc2_hsotg_map_dma(). That checking is done in functions called from those functions, usb_gadget_unmap_request_by_dev() and usb_gadget_map_request_by_dev() respectively, so it's unnecessary. Signed-off-by: Razmik Karapetyan <razmik@synopsys.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
c3b22fe2e4
commit
01719c2ef0
@ -316,11 +316,6 @@ static void dwc2_hsotg_unmap_dma(struct dwc2_hsotg *hsotg,
|
|||||||
struct dwc2_hsotg_req *hs_req)
|
struct dwc2_hsotg_req *hs_req)
|
||||||
{
|
{
|
||||||
struct usb_request *req = &hs_req->req;
|
struct usb_request *req = &hs_req->req;
|
||||||
|
|
||||||
/* ignore this if we're not moving any data */
|
|
||||||
if (hs_req->req.length == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->dir_in);
|
usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->dir_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1101,13 +1096,8 @@ static int dwc2_hsotg_map_dma(struct dwc2_hsotg *hsotg,
|
|||||||
struct dwc2_hsotg_ep *hs_ep,
|
struct dwc2_hsotg_ep *hs_ep,
|
||||||
struct usb_request *req)
|
struct usb_request *req)
|
||||||
{
|
{
|
||||||
struct dwc2_hsotg_req *hs_req = our_req(req);
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* if the length is zero, ignore the DMA data */
|
|
||||||
if (hs_req->req.length == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ret = usb_gadget_map_request(&hsotg->gadget, req, hs_ep->dir_in);
|
ret = usb_gadget_map_request(&hsotg->gadget, req, hs_ep->dir_in);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto dma_error;
|
goto dma_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user