pct1812_mmi: properly fail probe on i2c error

When I2C bus is unavailable, waiting for ready state will fail due to
I2C error and not just time out. In that case probe shall fail
gracefully and exit immediately.

Change-Id: Ida7e1877de0893d2d0e0941dbc3ef082ef7ba36f
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/2066631
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Konstantin Makariev 2021-09-14 13:50:55 -05:00 • committed by Konstantin Makariev
commit a8e63fa964

View file

@ -1504,8 +1504,8 @@ failure:
pct1812_set_bank(ts, BANK(6));
ret = pct1812_wait4ready(ts, BOOT_STATUS_REG, BOOT_COMPLETE);
if (ret == -ETIME) {
dev_err(ts->dev, "%s: Init timed out\n", __func__);
if (ret) {
dev_err(ts->dev, "%s: Failed to init\n", __func__);
}
mutex_unlock(&ts->cmdlock);
//__pm_relax(&ts->wake_src);
@ -2033,7 +2033,7 @@ static int pct1812_probe(struct i2c_client *client, const struct i2c_device_id *
pct1812_delay_ms(TOUCH_RESET_DELAY);
ret = pct1812_wait4ready(ts, BOOT_STATUS_REG, BOOT_COMPLETE);
if (ret == -ETIME) {
if (ret) {
dev_err(&client->dev, "%s: Failed to init\n", __func__);
goto error_init;
}