rtc: wm8350: Handle error for wm8350_register_irq
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 3 Mar 2022 08:50:30 +0000 (16:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:58:59 +0000 (20:58 +0200)
commitf8008f42d46377096178c43de6aeec81cd6f3eeb
tree383113d87c5ab64c1197a591b521314e9e52fdda
parentb257272f5483eaa0b2e5139d3ac2299e2cfd6100
rtc: wm8350: Handle error for wm8350_register_irq

[ Upstream commit 43f0269b6b89c1eec4ef83c48035608f4dcdd886 ]

As the potential failure of the wm8350_register_irq(),
it should be better to check it and return error if fails.
Also, it need not free 'wm_rtc->rtc' since it will be freed
automatically.

Fixes: 077eaf5b40ec ("rtc: rtc-wm8350: add support for WM8350 RTC")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220303085030.291793-1-jiasheng@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-wm8350.c