OSDN Git Service

usb: dwc3: gadget: Remove unnecessary checks
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 5 Mar 2020 21:24:14 +0000 (13:24 -0800)
committerFelipe Balbi <balbi@kernel.org>
Tue, 5 May 2020 07:58:52 +0000 (10:58 +0300)
commit8411993e79df8e54da67613025d620a8a23a24fe
treef5cda6769bf390e8a5f65247830eeed61204e678
parenta7027ca69d82ae10d9e5899b74e809e32d04d48b
usb: dwc3: gadget: Remove unnecessary checks

Remove 2 unnecessary checks:
1) A request in the started_list must have its trb field set. So
checking for req->trb is unnecessary.

2) An endpoint must have started (and have not ended) for the request to
still be in the started_list. There's no point to check if the endpoint
is started. We had this check because previously the driver didn't
handle the endpoint's started/ended flags for END_TRANSFER command
properly. See commit 9f45581f5eec ("usb: dwc3: gadget: early giveback
if End Transfer already completed").

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c