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 <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1285347
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Kenny Kessler 2018-12-19 10:46:04 -06:00 • committed by Kenneth Kessler
commit 795b56e6aa

View file

@ -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;
}