usb: dwc3: fix post-increment

Use pre-increment and set -ETIMEDOUT correctly.

Signed-off-by: Janusz Dziedzic <januszx.dziedzic@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Janusz Dziedzic 2016-11-09 11:01:33 +01:00 committed by Felipe Balbi
parent ce3fc8b329
commit e3aee48692

View file

@ -214,7 +214,7 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
ret = -EINVAL;
break;
}
} while (timeout--);
} while (--timeout);
if (!timeout) {
ret = -ETIMEDOUT;