drm/i2c: tda9950: fix timeout counter check
authorColin Ian King <colin.king@canonical.com>
Sun, 27 May 2018 21:42:55 +0000 (22:42 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 20 Sep 2018 16:13:23 +0000 (17:13 +0100)
commitd98627d1360d55e3b28f702caca8b6342c4a4e45
treee475cb32c694285a4c53be660d159df94bfe2c5e
parentf0316f93897c4c4e67278b175bfbfd3a95ba650a
drm/i2c: tda9950: fix timeout counter check

Currently the check to see if the timeout has reached zero is incorrect
and the check is instead checking if the timeout is non-zero and not
zero, hence it will break out of the loop on the first iteration and
the msleep is never executed.  Fix this by breaking from the loop when
timeout is zero.

Detected by CoverityScan, CID#1469404 ("Logically Dead Code")

Fixes: f0316f93897c ("drm/i2c: tda9950: add CEC driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/gpu/drm/i2c/tda9950.c