Merge tag 'for-linus-5.12-1' of git://github.com/cminyard/linux-ipmi
[linux-2.6-microblaze.git] / drivers / rtc / class.c
index 7e470fb..f77bc08 100644 (file)
@@ -231,6 +231,8 @@ static struct rtc_device *rtc_allocate_device(void)
        rtc->pie_timer.function = rtc_pie_update_irq;
        rtc->pie_enabled = 0;
 
+       set_bit(RTC_FEATURE_ALARM, rtc->features);
+
        return rtc;
 }
 
@@ -322,11 +324,6 @@ static void rtc_device_get_offset(struct rtc_device *rtc)
                rtc->offset_secs = 0;
 }
 
-/**
- * rtc_device_unregister - removes the previously registered RTC class device
- *
- * @rtc: the RTC class device to destroy
- */
 static void devm_rtc_unregister_device(void *data)
 {
        struct rtc_device *rtc = data;
@@ -386,6 +383,9 @@ int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
                return -EINVAL;
        }
 
+       if (!rtc->ops->set_alarm)
+               clear_bit(RTC_FEATURE_ALARM, rtc->features);
+
        rtc->owner = owner;
        rtc_device_get_offset(rtc);