summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-test.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-06-06 00:09:13 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-06-07 21:09:49 +0300
commit1928906d126f647ff025a54df4ed88c05b2afba9 (patch)
treeac38a0e6a8f83ceaa053423c7eb9dd1c113a542b /drivers/rtc/rtc-test.c
parent0b472ad2999c3dea6f9968db7c2ebe150e7eac14 (diff)
downloadlinux-1928906d126f647ff025a54df4ed88c05b2afba9.tar.xz
rtc: test: remove alarm support from the first device
To test for issues with RTCs that don't provide an alarm, remove alarm support from the first test RTC device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-test.c')
-rw-r--r--drivers/rtc/rtc-test.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 0c30b04326c5..8469256edc2a 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -95,6 +95,12 @@ static int test_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
return 0;
}
+static const struct rtc_class_ops test_rtc_ops_noalm = {
+ .read_time = test_rtc_read_time,
+ .set_mmss64 = test_rtc_set_mmss64,
+ .alarm_irq_enable = test_rtc_alarm_irq_enable,
+};
+
static const struct rtc_class_ops test_rtc_ops = {
.read_time = test_rtc_read_time,
.read_alarm = test_rtc_read_alarm,
@@ -124,7 +130,13 @@ static int test_probe(struct platform_device *plat_dev)
if (IS_ERR(rtd->rtc))
return PTR_ERR(rtd->rtc);
- rtd->rtc->ops = &test_rtc_ops;
+ switch (plat_dev->id) {
+ case 0:
+ rtd->rtc->ops = &test_rtc_ops_noalm;
+ break;
+ default:
+ rtd->rtc->ops = &test_rtc_ops;
+ }
timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0);
rtd->alarm.expires = 0;