power: qpnp-bms: fix rtc cleanup

Currently the BMS tries to close the rtc class if it fails to open.
However, when this happens, the open function returns NULL. Passing
a NULL to the rtc_class_close function crashes the kernel.

Fix this by doing nothing if the rtc class fails to open.

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