diff options
author | Edward Hill <ecgh@chromium.org> | 2020-07-09 19:33:05 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-11 01:34:01 +0000 |
commit | ce32396e6cfbc3ee3a1911338e77816fddd2843d (patch) | |
tree | 7294ae62d29b381ec0e0cfc8f599bfad56a980a7 /common/usbc_ppc.c | |
parent | dccc9023faec5a7c55487fcf6ca6d1b96d4cd08e (diff) | |
download | chrome-ec-ce32396e6cfbc3ee3a1911338e77816fddd2843d.tar.gz |
ppc: Fix return values of ppc_is_* to be boolean
The return values for ppc_is_sourcing_vbus(), ppc_is_port_latched_off(),
ppc_is_vbus_present() are boolean, so EC_ERROR_UNIMPLEMENTED and
EC_ERROR_INVAL cannot be returned.
BUG=none
BRANCH=none
TEST=none
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: Ic56fd5ac75e5f0ad6e21c803feb929983f08aaf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2290664
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'common/usbc_ppc.c')
-rw-r--r-- | common/usbc_ppc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/usbc_ppc.c b/common/usbc_ppc.c index c3710c0852..cd37e0e8cf 100644 --- a/common/usbc_ppc.c +++ b/common/usbc_ppc.c @@ -125,12 +125,12 @@ int ppc_clear_oc_event_counter(int port) int ppc_is_sourcing_vbus(int port) { - int rv = EC_ERROR_UNIMPLEMENTED; + int rv = 0; const struct ppc_config_t *ppc; if ((port < 0) || (port >= ppc_cnt)) { CPRINTS("%s(%d) Invalid port!", __func__, port); - return EC_ERROR_INVAL; + return 0; } ppc = &ppc_chips[port]; @@ -197,7 +197,7 @@ int ppc_is_port_latched_off(int port) { if ((port < 0) || (port >= ppc_cnt)) { CPRINTS("%s(%d) Invalid port!", __func__, port); - return EC_ERROR_INVAL; + return 0; } return oc_event_cnt_tbl[port] >= PPC_OC_CNT_THRESH; @@ -346,12 +346,12 @@ int ppc_set_frs_enable(int port, int enable) #ifdef CONFIG_USB_PD_VBUS_DETECT_PPC int ppc_is_vbus_present(int port) { - int rv = EC_ERROR_UNIMPLEMENTED; + int rv = 0; const struct ppc_config_t *ppc; if ((port < 0) || (port >= ppc_cnt)) { CPRINTS("%s(%d) Invalid port!", __func__, port); - return EC_ERROR_INVAL; + return 0; } ppc = &ppc_chips[port]; |