Input: rohm_bu21023 - fix handling of retrying firmware update
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 6 Jan 2016 22:44:02 +0000 (14:44 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 7 Jan 2016 17:57:21 +0000 (09:57 -0800)
Because of the wrong condition we'd never retry firmware update.

Acked-by: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/rohm_bu21023.c

index ba6024f934696c06934264c365f4f6bf930914f0..611156a2ef80d7a1381597d59444083807316bd9 100644 (file)
@@ -725,7 +725,7 @@ static int rohm_ts_load_firmware(struct i2c_client *client,
                        break;
 
                error = -EIO;
-       } while (++retry >= FIRMWARE_RETRY_MAX);
+       } while (++retry <= FIRMWARE_RETRY_MAX);
 
 out:
        error2 = i2c_smbus_write_byte_data(client, INT_MASK, INT_ALL);