#endif /* CONFIG_RTC_DRV_RV3029_HWMON */
-static struct rtc_class_ops rv3029_rtc_ops = {
+static const struct rtc_class_ops rv3029_rtc_ops = {
.read_time = rv3029_read_time,
.set_time = rv3029_set_time,
.ioctl = rv3029_ioctl,
+ .read_alarm = rv3029_read_alarm,
+ .set_alarm = rv3029_set_alarm,
+ .alarm_irq_enable = rv3029_alarm_irq_enable,
};
static int rv3029_probe(struct device *dev, struct regmap *regmap, int irq,
if (rc) {
dev_warn(dev, "unable to request IRQ, alarms disabled\n");
rv3029->irq = 0;
- } else {
- rv3029_rtc_ops.read_alarm = rv3029_read_alarm;
- rv3029_rtc_ops.set_alarm = rv3029_set_alarm;
- rv3029_rtc_ops.alarm_irq_enable = rv3029_alarm_irq_enable;
}
}
+ if (!rv3029->irq)
+ clear_bit(RTC_FEATURE_ALARM, rv3029->rtc->features);
rv3029->rtc->ops = &rv3029_rtc_ops;
rv3029->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;