summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/tcpm/tcpci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 40bcc7765d..6eaf2cd8cd 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -206,9 +206,11 @@ int tcpci_tcpm_get_vbus_level(int port)
int reg;
/* Read Power Status register */
- tcpci_tcpm_get_power_status(port, &reg);
- /* Update VBUS status */
- return reg & TCPC_REG_POWER_STATUS_VBUS_PRES ? 1 : 0;
+ if (tcpci_tcpm_get_power_status(port, &reg) == EC_SUCCESS)
+ return reg & TCPC_REG_POWER_STATUS_VBUS_PRES ? 1 : 0;
+
+ /* If read failed, report that Vbus is off */
+ return 0;
}
#endif