]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
rtc: pl031: use RTC_FEATURE_ALARM
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 10 Jan 2021 23:17:37 +0000 (00:17 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 16 Jan 2021 22:19:26 +0000 (23:19 +0100)
Clear RTC_FEATURE_ALARM instead of setting set_alarm, read_alarm and
alarm_irq_enable to NULL.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210110231752.1418816-3-alexandre.belloni@bootlin.com
drivers/rtc/rtc-pl031.c

index 224bbf0962622a7ac5ac44c430f6969206346051..7c3967df4f9a1f029db2d86f2d11d435378c4c12 100644 (file)
@@ -352,12 +352,8 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
                }
        }
 
-       if (!adev->irq[0]) {
-               /* When there's no interrupt, no point in exposing the alarm */
-               ops->read_alarm = NULL;
-               ops->set_alarm = NULL;
-               ops->alarm_irq_enable = NULL;
-       }
+       if (!adev->irq[0])
+               clear_bit(RTC_FEATURE_ALARM, ldata->rtc->features);
 
        device_init_wakeup(&adev->dev, true);
        ldata->rtc = devm_rtc_allocate_device(&adev->dev);