]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtc: class: Remove duplicate check for alarm
authorJinjie Ruan <ruanjinjie@huawei.com>
Thu, 22 Jan 2026 09:00:31 +0000 (17:00 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 20 Feb 2026 22:12:17 +0000 (23:12 +0100)
In __devm_rtc_register_device(), the callee rtc_initialize_alarm()
will check the alarm, there is no need to check in advance,
so remove it.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20260122090031.3871746-1-ruanjinjie@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/class.c

index b1a2be1f9e3b934e9bc5864006500e0b713d3f1f..84885ba6135ceba663ce6708f0085a664f6aa598 100644 (file)
@@ -410,7 +410,7 @@ int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
 
        /* Check to see if there is an ALARM already set in hw */
        err = __rtc_read_alarm(rtc, &alrm);
-       if (!err && !rtc_valid_tm(&alrm.time))
+       if (!err)
                rtc_initialize_alarm(rtc, &alrm);
 
        rtc_dev_prepare(rtc);