summary refs log tree commit diff
path: root/drivers/usb/dwc3/core.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-06-09 16:47:05 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-06-21 10:38:43 +0300
commitb6d4e16e831376b676edb3463f2bdaa192e5f7be (patch)
tree9934cc51cff344e1eafdcbc489b5cba605013fb5 /drivers/usb/dwc3/core.c
parentf2df679b6c556fd3b0b7ffafea170f1679086455 (diff)
downloadlinux-b6d4e16e831376b676edb3463f2bdaa192e5f7be.tar.gz
usb: dwc3: gadget: simplify run_stop() break condition
it's clear now that when is_on=true, we must loop
until DWC3_DSTS_DEVCTRLHLT clears; while when
is_on=false we must loop until DWC3_DSTS_DEVCTRLHLT
gets set.

Instead of adding actual if() statements, we can
rely on XOR operation to evaluate to true only when
the above conditions apply. Then, we can move the
break condition back to the while() statement
together with our timeout check and the resulting
code is very compact and simpler to read.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
0 files changed, 0 insertions, 0 deletions