Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 304f7e5e authored by Michal Sojka's avatar Michal Sojka Committed by Greg Kroah-Hartman
Browse files

usb: gadget: Refactor request completion



Use the recently introduced usb_gadget_giveback_request() in favor of
direct invocation of the completion routine.

All places in drivers/usb/ matching "[-.]complete(" were replaced with a
call to usb_gadget_giveback_request(). This was compile-tested with all
ARM drivers enabled and runtime-tested for musb.

Signed-off-by: default avatarMichal Sojka <sojka@merica.cz>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Tested-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3fc2aa55
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ __acquires(hwep->lock)

		if (hwreq->req.complete != NULL) {
			spin_unlock(hwep->lock);
			hwreq->req.complete(&hwep->ep, &hwreq->req);
			usb_gadget_giveback_request(&hwep->ep, &hwreq->req);
			spin_lock(hwep->lock);
		}
	}
@@ -922,7 +922,7 @@ __acquires(hwep->lock)
			if ((hwep->type == USB_ENDPOINT_XFER_CONTROL) &&
					hwreq->req.length)
				hweptemp = hwep->ci->ep0in;
			hwreq->req.complete(&hweptemp->ep, &hwreq->req);
			usb_gadget_giveback_request(&hweptemp->ep, &hwreq->req);
			spin_lock(hwep->lock);
		}
	}
@@ -1347,7 +1347,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)

	if (hwreq->req.complete != NULL) {
		spin_unlock(hwep->lock);
		hwreq->req.complete(&hwep->ep, &hwreq->req);
		usb_gadget_giveback_request(&hwep->ep, &hwreq->req);
		spin_lock(hwep->lock);
	}

+3 −3
Original line number Diff line number Diff line
@@ -1004,7 +1004,7 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg,
					hs_req = ep->req;
					ep->req = NULL;
					list_del_init(&hs_req->queue);
					hs_req->req.complete(&ep->ep,
					usb_gadget_giveback_request(&ep->ep,
								    &hs_req->req);
				}

@@ -1262,7 +1262,7 @@ static void s3c_hsotg_complete_request(struct s3c_hsotg *hsotg,

	if (hs_req->req.complete) {
		spin_unlock(&hsotg->lock);
		hs_req->req.complete(&hs_ep->ep, &hs_req->req);
		usb_gadget_giveback_request(&hs_ep->ep, &hs_req->req);
		spin_lock(&hsotg->lock);
	}

+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
	trace_dwc3_gadget_giveback(req);

	spin_unlock(&dwc->lock);
	req->request.complete(&dep->endpoint, &req->request);
	usb_gadget_giveback_request(&dep->endpoint, &req->request);
	spin_lock(&dwc->lock);
}

+1 −1
Original line number Diff line number Diff line
@@ -841,7 +841,7 @@ __acquires(ep->dev->lock)
		&req->req, req->req.length, ep->ep.name, sts);

	spin_unlock(&dev->lock);
	req->req.complete(&ep->ep, &req->req);
	usb_gadget_giveback_request(&ep->ep, &req->req);
	spin_lock(&dev->lock);
	ep->halted = halted;
}
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static void done(struct at91_ep *ep, struct at91_request *req, int status)

	ep->stopped = 1;
	spin_unlock(&udc->lock);
	req->req.complete(&ep->ep, &req->req);
	usb_gadget_giveback_request(&ep->ep, &req->req);
	spin_lock(&udc->lock);
	ep->stopped = stopped;

Loading