summaryrefslogtreecommitdiff
path: root/driver/tcpm/tcpci.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/tcpm/tcpci.c')
-rw-r--r--driver/tcpm/tcpci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 5c49bceb76..51ddcb5901 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -745,13 +745,13 @@ int tcpci_tcpm_init(int port)
error = tcpc_read(port, TCPC_REG_POWER_STATUS, &power_status);
/*
* If read succeeds and the uninitialized bit is clear, then
- * initalization is complete, clear all alert bits and write
+ * initialization is complete, clear all alert bits and write
* the initial alert mask.
*/
if (!error && !(power_status & TCPC_REG_POWER_STATUS_UNINIT))
break;
- else if (error && --tries == 0)
- return error;
+ if (--tries <= 0)
+ return error ? error : EC_ERROR_TIMEOUT;
msleep(10);
}
@@ -797,8 +797,8 @@ int tcpci_tcpm_mux_init(int port)
*/
if (!error && !(power_status & TCPC_REG_POWER_STATUS_UNINIT))
break;
- else if (error && --tries == 0)
- return error;
+ if (--tries <= 0)
+ return error ? error : EC_ERROR_TIMEOUT;
msleep(10);
}