diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 0314773f6db382692f509471ab49ea27208d40d8..94923d259910ee16258a6bf6b6dcaf091ccf2244 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -68,7 +68,7 @@ static int als_wait_for_data_ready(struct device *dev) ret = i2c_smbus_read_byte_data(client, 0x86); } while (!(ret & 0x80) && retry--); - if (!retry) { + if (retry < 0) { dev_warn(dev, "timeout waiting for data ready\n"); return -ETIMEDOUT; }