google_cpm: avoid return error from the ta_check in set_property
Don't return the error code from gcpm_chg_select_logic in ta_check.
There is a retry to handle that error.
Bug: 213395207
Signed-off-by: Wasb Liu <[email protected]>
Change-Id: I169cfe2c1ff06723a348f8431fa13249cdc745dc
(cherry picked from commit eef885bcd980b611ba1fb2490b3d058683a1a504)
diff --git a/google_cpm.c b/google_cpm.c
index 2427d0b..353c555 100644
--- a/google_cpm.c
+++ b/google_cpm.c
@@ -2048,14 +2048,15 @@
*/
if (gcpm->dc_init_complete && ta_check) {
const bool was_dc = gcpm_is_dc(gcpm, gcpm->dc_index);
+ int rc;
/*
* Synchronous! might kick off gcpm_pps_wlc_dc_work to negotiate
* DC charging. -EAGAIN will cause this code to be called again.
* NOTE: gcpm_chg_select_logic() might change gcpm->dc_index
*/
- ret = gcpm_chg_select_logic(gcpm);
- if (ret == -EAGAIN) {
+ rc = gcpm_chg_select_logic(gcpm);
+ if (rc == -EAGAIN) {
const int interval = 5; /* seconds */
/* let the setting go through but */