summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-cmos.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-11 00:17:39 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-16 23:19:26 +0100
commit30f5bd537fdb6124b9955858b301577ce4eb8dcd (patch)
treecf0aa4ae42f1380d5e7962f3ce398b786da1ade9 /drivers/rtc/rtc-cmos.c
parentrtc: armada38x: remove armada38x_rtc_ops_noirq (diff)
downloadlinux-30f5bd537fdb6124b9955858b301577ce4eb8dcd.tar.xz
linux-30f5bd537fdb6124b9955858b301577ce4eb8dcd.zip
rtc: cmos: remove cmos_rtc_ops_no_alarm
Clear RTC_FEATURE_ALARM to signal that alarms are not available instead of having a supplementary struct rtc_class_ops with a NULL .set_alarm. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210110231752.1418816-5-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-rw-r--r--drivers/rtc/rtc-cmos.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 51e80bc70d42..c3746e249f5a 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -574,12 +574,6 @@ static const struct rtc_class_ops cmos_rtc_ops = {
.alarm_irq_enable = cmos_alarm_irq_enable,
};
-static const struct rtc_class_ops cmos_rtc_ops_no_alarm = {
- .read_time = cmos_read_time,
- .set_time = cmos_set_time,
- .proc = cmos_procfs,
-};
-
/*----------------------------------------------------------------*/
/*
@@ -857,12 +851,12 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq);
goto cleanup1;
}
-
- cmos_rtc.rtc->ops = &cmos_rtc_ops;
} else {
- cmos_rtc.rtc->ops = &cmos_rtc_ops_no_alarm;
+ clear_bit(RTC_FEATURE_ALARM, cmos_rtc.rtc->features);
}
+ cmos_rtc.rtc->ops = &cmos_rtc_ops;
+
retval = devm_rtc_register_device(cmos_rtc.rtc);
if (retval)
goto cleanup2;