power: qpnp-smbcharger: handle the regulator probe deferral properly
Currently, if regulator_register() of smbcharger-external-otg
regulator returns an error (e.g. -EPROBE_DEFER),
regulator_unregister() is not called for smbcharger-boost-otg
regulator which got registered before that.
This causes problems during bootup later because of an invalid
regulator device being left registered indefinitely.
Fix this by changing the driver to use devm_regulator_register()
for registering the regulators. This fixes the issue by taking
care of unregistering the regulators automatically. Since this
eliminates the need for smbchg_regulator_deinit() in charger
driver, remove it.
CRs-Fixed: 895622
Change-Id: I363693888f357555dbb82ef2566ed855cea9fe94
Signed-off-by:
Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Loading
Please register or sign in to comment