mirror of https://gitee.com/openkylin/linux.git
rtc: mv: remove mv_rtc_alarm_ops
Move the alarm callbacks in mv_rtc_ops and clear RTC_FEATURE_ALARM to signal that alarms are not available instead of having a supplementary struct rtc_class_ops. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210110231752.1418816-6-alexandre.belloni@bootlin.com
This commit is contained in:
parent
30f5bd537f
commit
b0d42defe1
|
@ -200,11 +200,6 @@ static irqreturn_t mv_rtc_interrupt(int irq, void *data)
|
|||
static const struct rtc_class_ops mv_rtc_ops = {
|
||||
.read_time = mv_rtc_read_time,
|
||||
.set_time = mv_rtc_set_time,
|
||||
};
|
||||
|
||||
static const struct rtc_class_ops mv_rtc_alarm_ops = {
|
||||
.read_time = mv_rtc_read_time,
|
||||
.set_time = mv_rtc_set_time,
|
||||
.read_alarm = mv_rtc_read_alarm,
|
||||
.set_alarm = mv_rtc_set_alarm,
|
||||
.alarm_irq_enable = mv_rtc_alarm_irq_enable,
|
||||
|
@ -268,13 +263,12 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
if (pdata->irq >= 0) {
|
||||
if (pdata->irq >= 0)
|
||||
device_init_wakeup(&pdev->dev, 1);
|
||||
pdata->rtc->ops = &mv_rtc_alarm_ops;
|
||||
} else {
|
||||
pdata->rtc->ops = &mv_rtc_ops;
|
||||
}
|
||||
else
|
||||
clear_bit(RTC_FEATURE_ALARM, pdata->rtc->features);
|
||||
|
||||
pdata->rtc->ops = &mv_rtc_ops;
|
||||
pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
|
||||
pdata->rtc->range_max = RTC_TIMESTAMP_END_2099;
|
||||
|
||||
|
|
Loading…
Reference in New Issue