mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
rtc: pic32: Move devm_rtc_allocate_device earlier in pic32_rtc_probe()
[ Upstream commit90cd5c8883
] The pic32_rtc_enable(pdata, 0) and clk_disable_unprepare(pdata->clk) should be called in the error handling of devm_rtc_allocate_device(), so we should move devm_rtc_allocate_device earlier in pic32_rtc_probe() to fix it. Fixes:6515e23b9f
("rtc: pic32: convert to devm_rtc_allocate_device") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Link: https://lore.kernel.org/r/20221123015953.1998521-1-cuigaosheng1@huawei.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
34836c5923
commit
e9453c13ae
1 changed files with 4 additions and 4 deletions
|
@ -324,16 +324,16 @@ static int pic32_rtc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
spin_lock_init(&pdata->alarm_lock);
|
spin_lock_init(&pdata->alarm_lock);
|
||||||
|
|
||||||
|
pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
|
||||||
|
if (IS_ERR(pdata->rtc))
|
||||||
|
return PTR_ERR(pdata->rtc);
|
||||||
|
|
||||||
clk_prepare_enable(pdata->clk);
|
clk_prepare_enable(pdata->clk);
|
||||||
|
|
||||||
pic32_rtc_enable(pdata, 1);
|
pic32_rtc_enable(pdata, 1);
|
||||||
|
|
||||||
device_init_wakeup(&pdev->dev, 1);
|
device_init_wakeup(&pdev->dev, 1);
|
||||||
|
|
||||||
pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
|
|
||||||
if (IS_ERR(pdata->rtc))
|
|
||||||
return PTR_ERR(pdata->rtc);
|
|
||||||
|
|
||||||
pdata->rtc->ops = &pic32_rtcops;
|
pdata->rtc->ops = &pic32_rtcops;
|
||||||
pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
|
pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
|
||||||
pdata->rtc->range_max = RTC_TIMESTAMP_END_2099;
|
pdata->rtc->range_max = RTC_TIMESTAMP_END_2099;
|
||||||
|
|
Loading…
Reference in a new issue