Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e918366 authored by GUO Zihua's avatar GUO Zihua Committed by Greg Kroah-Hartman
Browse files

rtc: mxc_v2: Add missing clk_disable_unprepare()



[ Upstream commit 55d5a86618d3b1a768bce01882b74cbbd2651975 ]

The call to clk_disable_unprepare() is left out in the error handling of
devm_rtc_allocate_device. Add it back.

Fixes: 5490a1e0 ("rtc: mxc_v2: fix possible race condition")
Signed-off-by: default avatarGUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20221122085046.21689-1-guozihua@huawei.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b0a61359
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -337,8 +337,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
	}

	pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
	if (IS_ERR(pdata->rtc))
	if (IS_ERR(pdata->rtc)) {
		clk_disable_unprepare(pdata->clk);
		return PTR_ERR(pdata->rtc);
	}

	pdata->rtc->ops = &mxc_rtc_ops;
	pdata->rtc->range_max = U32_MAX;