Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: ab-eoz9: make use of RTC_FEATURE_ALARM

Move the alarm callbacks in rtc_ops and use RTC_FEATURE_ALARM to notify
the core whether alarm capabilities are available or not.

Signed-off-by: Liam Beguin <lvb@xiphos.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210408024028.3526564-4-liambeguin@gmail.com

authored by

Liam Beguin and committed by
Alexandre Belloni
c52409eb e70e52e1

+2 -6
+2 -6
drivers/rtc/rtc-ab-eoz9.c
··· 369 369 370 370 static const struct rtc_class_ops rtc_ops = { 371 371 .read_time = abeoz9_rtc_get_time, 372 - .set_time = abeoz9_rtc_set_time, 373 - }; 374 - 375 - static const struct rtc_class_ops rtc_alarm_ops = { 376 - .read_time = abeoz9_rtc_get_time, 377 372 .set_time = abeoz9_rtc_set_time, 378 373 .read_alarm = abeoz9_rtc_read_alarm, 379 374 .set_alarm = abeoz9_rtc_set_alarm, ··· 535 540 data->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; 536 541 data->rtc->range_max = RTC_TIMESTAMP_END_2099; 537 542 data->rtc->uie_unsupported = 1; 543 + clear_bit(RTC_FEATURE_ALARM, data->rtc->features); 538 544 539 545 if (client->irq > 0) { 540 546 ret = devm_request_threaded_irq(dev, client->irq, NULL, ··· 550 554 551 555 if (client->irq > 0 || device_property_read_bool(dev, "wakeup-source")) { 552 556 ret = device_init_wakeup(dev, true); 553 - data->rtc->ops = &rtc_alarm_ops; 557 + set_bit(RTC_FEATURE_ALARM, data->rtc->features); 554 558 } 555 559 556 560 ret = devm_rtc_register_device(data->rtc);