power: qpnp-bms: Check for initialization of bms_psy

There is currently a bug in the BMS driver that can cause a kernel
panic. The if an ADC notification arrives before the BMS power supply
is registered, the BMS driver can cause a spin lock bad magic because
the bms_psy is not yet registered.

Fix this by checking if the power supply is registered before calling
power_supply_changed.

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