power: qpnp-bms: fix divide by zero error
UUC can sometimes be calculated to be 100% of FCC currently. This
makes available charge (FCC - UUC) equal to 0. The BMS driver current
skips calculating soc and simply reports 0% if this happens. However,
it does not skip adjust_soc, and may cause a divide by zero error if
this happens.
Fix this issue by skipping adjust_soc also when calculating soc with
0 available charge.
Change-Id: I27bd8fb9fa6f4da2dfde760020fd0e0ea573a2c7
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
1 file changed