Merge tag 'clang-lto-v5.12-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / rtc / rtc-cmos.c
index a701dae..670fd8a 100644 (file)
@@ -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,
-};
-
 /*----------------------------------------------------------------*/
 
 /*
@@ -649,11 +643,10 @@ static struct cmos_rtc    cmos_rtc;
 
 static irqreturn_t cmos_interrupt(int irq, void *p)
 {
-       unsigned long   flags;
        u8              irqstat;
        u8              rtc_control;
 
-       spin_lock_irqsave(&rtc_lock, flags);
+       spin_lock(&rtc_lock);
 
        /* When the HPET interrupt handler calls us, the interrupt
         * status is passed as arg1 instead of the irq number.  But
@@ -687,7 +680,7 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
                        hpet_mask_rtc_irq_bit(RTC_AIE);
                CMOS_READ(RTC_INTR_FLAGS);
        }
-       spin_unlock_irqrestore(&rtc_lock, flags);
+       spin_unlock(&rtc_lock);
 
        if (is_intr(irqstat)) {
                rtc_update_irq(p, 1, irqstat);
@@ -865,12 +858,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;