From 795b56e6aa461177575fd1bc3a30f0f365045d55 Mon Sep 17 00:00:00 2001 From: Kenny Kessler Date: Wed, 19 Dec 2018 10:46:04 -0600 Subject: [PATCH] power: qpnp-smbcharger-mmi: Soft fail on Missing If a battery property fails to report then send a status 0 with -EINVAL for the value. This way the error will not cause a mass reading of files to stop as in the uevent. Change-Id: If9b014a8346b3f307da9a88e178d456a832a1a43 Signed-off-by: Kenny Kessler Reviewed-on: https://gerrit.mot.com/1285347 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ryan Lattrel Reviewed-by: Kenneth Kessler Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 7a849b079c34..3658a4b627bd 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -2452,6 +2452,7 @@ static enum power_supply_property batt_props[] = { POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CURRENT_QNOVO, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, + POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_TECHNOLOGY, @@ -2469,7 +2470,6 @@ static enum power_supply_property batt_props[] = { POWER_SUPPLY_PROP_CYCLE_COUNT, POWER_SUPPLY_PROP_RECHARGE_SOC, POWER_SUPPLY_PROP_CHARGE_FULL, - POWER_SUPPLY_PROP_FORCE_RECHARGE, POWER_SUPPLY_PROP_FCC_STEPPER_ENABLE, }; @@ -2497,6 +2497,12 @@ static int batt_get_prop(struct power_supply *psy, break; default: rc = power_supply_get_property(chip->qcom_psy, psp, val); + if (rc < 0) { + pr_debug("Get Unknown prop %d rc = %d\n", psp, rc); + /* soft fail so uevents are not blocked */ + rc = 0; + val->intval = -EINVAL; + } break; }