power: qpnp-bms: qpnp-charger: prevent loading null batterydata

Currently, the BMS and Charger tries to load battery properties from
the devicetree battery data node. However, currently the drivers only
check for a non-negative number before loading the properties. This
can cause null batterydata nodes to be loaded as 0s for all
properties.

Fix this by first intializing the properties to -1 before loading the
batterydata.

CRs-Fixed: 518407
Change-Id: Iede14a6ba5dd0d307a1bdd8f813c509f718acfe6
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
diff --git a/drivers/power/qpnp-charger.c b/drivers/power/qpnp-charger.c
index 7ccd49d..1deb765 100644
--- a/drivers/power/qpnp-charger.c
+++ b/drivers/power/qpnp-charger.c
@@ -2829,6 +2829,8 @@
 			return rc;
 		}
 
+		batt_data.max_voltage_uv = -1;
+		batt_data.iterm_ua = -1;
 		rc = of_batterydata_read_data(node,
 				&batt_data, result.physical);
 		if (rc) {