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

Commit 0dc0724b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: diag: Use controller's driver ZLP support on IN endpoint" into msm-4.9

parents fed077c3 8673b853
Loading
Loading
Loading
Loading
+3 −15
Original line number Original line Diff line number Diff line
@@ -307,21 +307,8 @@ static void diag_write_complete(struct usb_ep *ep,


	ctxt->dpkts_tolaptop_pending--;
	ctxt->dpkts_tolaptop_pending--;


	if (!req->status) {
	if (!req->status)
		if ((req->length >= ep->maxpacket) &&
				((req->length % ep->maxpacket) == 0)) {
			ctxt->dpkts_tolaptop_pending++;
			req->length = 0;
			d_req->actual = req->actual;
			d_req->status = req->status;
			/* Queue zero length packet */
			if (!usb_ep_queue(ctxt->in, req, GFP_ATOMIC))
				return;
			ctxt->dpkts_tolaptop_pending--;
		} else {
		ctxt->dpkts_tolaptop++;
		ctxt->dpkts_tolaptop++;
		}
	}


	spin_lock_irqsave(&ctxt->lock, flags);
	spin_lock_irqsave(&ctxt->lock, flags);
	list_add_tail(&req->list, &ctxt->write_pool);
	list_add_tail(&req->list, &ctxt->write_pool);
@@ -481,6 +468,7 @@ int usb_diag_alloc_req(struct usb_diag_ch *ch, int n_write, int n_read)
			goto fail;
			goto fail;
		kmemleak_not_leak(req);
		kmemleak_not_leak(req);
		req->complete = diag_write_complete;
		req->complete = diag_write_complete;
		req->zero = true;
		list_add_tail(&req->list, &ctxt->write_pool);
		list_add_tail(&req->list, &ctxt->write_pool);
	}
	}