rtc: rzn1: Check return value in rzn1_rtc_probe

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2183349

commit 9800f24f7bd5b99fb4fc4ce981427102e2e15a1c
Author: Yushan Zhou <katrinzhou@tencent.com>
Date:   Mon Nov 7 17:25:44 2022 +0800

    rtc: rzn1: Check return value in rzn1_rtc_probe

    The rzn1_rtc_probe() function utilizes devm_pm_runtime_enable()
    but wasn't checking the return value. Fix it by adding missing
    check.

    Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver")

    Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
    Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/r/20221107092544.3721053-1-zys.zljxml@gmail.com
    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    (cherry picked from commit 9800f24f7bd5b99fb4fc4ce981427102e2e15a1c)

Signed-off-by: Gavin Shan <gshan@redhat.com>
This commit is contained in:
Gavin Shan 2023-05-30 13:35:08 +10:00
parent 52f6cac442
commit 1e409470e5
1 changed files with 3 additions and 1 deletions

View File

@ -355,7 +355,9 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
devm_pm_runtime_enable(&pdev->dev);
ret = devm_pm_runtime_enable(&pdev->dev);
if (ret < 0)
return ret;
ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret < 0)
return ret;