4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold johan@kernel.org
commit 551757eb052986ec81cebcc6301cc1c4f8dca938 upstream.
Make sure to deregister the pin controller in case rtc registration fails.
Fixes: 57072758623f ("rtc: omap: switch to rtc_register_device") Cc: stable stable@vger.kernel.org # 4.14 Cc: Alexandre Belloni alexandre.belloni@free-electrons.com Signed-off-by: Johan Hovold johan@kernel.org Signed-off-by: Alexandre Belloni alexandre.belloni@bootlin.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
--- drivers/rtc/rtc-omap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -880,12 +880,14 @@ static int omap_rtc_probe(struct platfor
ret = rtc_register_device(rtc->rtc); if (ret) - goto err; + goto err_deregister_pinctrl;
rtc_nvmem_register(rtc->rtc, &omap_rtc_nvmem_config);
return 0;
+err_deregister_pinctrl: + pinctrl_unregister(rtc->pctldev); err: clk_disable_unprepare(rtc->clk); device_init_wakeup(&pdev->dev, false);