rtc: ftrtc010: Fix error handling in ftrtc010_rtc_probe
authorMiaoqian Lin <linmq006@gmail.com>
Sun, 3 Apr 2022 05:49:12 +0000 (05:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:07 +0000 (18:36 +0200)
commite1928887219b09140c043eed13fbd30bf22bd68e
treed743917e24e7ccefa65241340718576b9ea52fdd
parent49f698e2205299224dbf4599e87ca1b1d78683c3
rtc: ftrtc010: Fix error handling in ftrtc010_rtc_probe

[ Upstream commit b520cbe5be37b1b9b401c0b6ecbdae32575273db ]

In the error handling path, the clk_prepare_enable() function
call should be balanced by a corresponding 'clk_disable_unprepare()'
call , as already done in the remove function.

clk_disable_unprepare calls clk_disable() and clk_unprepare().
They will use IS_ERR_OR_NULL to check the argument.

Fixes: ac05fba39cc5 ("rtc: gemini: Add optional clock handling")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220403054912.31739-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-ftrtc010.c