Skip to content
Snippets Groups Projects
Commit 8c865018 authored by Matej Frančeškin's avatar Matej Frančeškin Committed by Marek Vasut
Browse files

MUSB driver: Timeout is never detected as the while loop does not end


Timeout variable is decremented once more when while condition is not met.
Following "if" does not detect correctly that timeout has occurred.
Because of this bug the "usb start" command on AM335X-EVM board did not detect correctly that USB device was not attached.

	timeout = musb_cfg.timeout;
	while (timeout--)
		if (readb(&musbr->devctl) & MUSB_DEVCTL_HM)
 			break;
	/* if musb core is not in host mode, then return */
	if (!timeout)
		return -1;

Signed-off-by: default avatarMatej Franceskin <Matej.Franceskin@comtrade.com>
CC: Marek Vasut <matex@denx.de>?
parent 749f8180
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment