of_batterydata: Fix possible divide by 0 conditions

If the Battery ID is either short circuited or floating, the
batterydata loading may cause a divide by 0 warning when calculating
the Battery ID resistance.

Fix this by checking for 0 denominators before doing the divisions
and returning 0 kOhms for the Battery ID resistance.

Change-Id: Ia631d8bdbdf6be838c7cfe2ea9601da9dea45636
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
1 file changed