• Felipe Balbi's avatar
    usb: dwc3: gadget: simplify run_stop() break condition · b6d4e16e
    Felipe Balbi authored
    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: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
    b6d4e16e
gadget.c 74.6 KB