* [LTP] [PATCH] device-drivers/rtc: handle EINVAL on RTC_ALM_READ
@ 2016-09-30 14:42 Richard Palethorpe
2016-10-04 15:57 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Richard Palethorpe @ 2016-09-30 14:42 UTC (permalink / raw)
To: ltp
Report TCONF result after RTC_ALM_READ fails with EINVAL and skip
displaying the alarm time when this happens.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
testcases/kernel/device-drivers/rtc/rtc01.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/device-drivers/rtc/rtc01.c b/testcases/kernel/device-drivers/rtc/rtc01.c
index 7f9bc07..b3c7e1d 100644
--- a/testcases/kernel/device-drivers/rtc/rtc01.c
+++ b/testcases/kernel/device-drivers/rtc/rtc01.c
@@ -108,12 +108,17 @@ void read_alarm_test(void)
/*Read current alarm time */
ret = ioctl(rtc_fd, RTC_ALM_READ, &rtc_tm);
if (ret == -1) {
- tst_resm(TFAIL | TERRNO, "RTC_ALM_READ ioctl failed");
- return;
+ if (errno == EINVAL) {
+ tst_resm(TCONF | TERRNO, "RTC_ALM_READ not suported");
+ } else {
+ tst_resm(TFAIL | TERRNO, "RTC_ALM_READ ioctl failed");
+ return;
+ }
+ } else {
+ tst_resm(TINFO, "Alarm time set to %02d:%02d:%02d.",
+ rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
}
- tst_resm(TINFO, "Alarm time set to %02d:%02d:%02d.",
- rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
/* Enable alarm interrupts */
ret = ioctl(rtc_fd, RTC_AIE_ON, 0);
if (ret == -1) {
--
2.10.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] device-drivers/rtc: handle EINVAL on RTC_ALM_READ
2016-09-30 14:42 [LTP] [PATCH] device-drivers/rtc: handle EINVAL on RTC_ALM_READ Richard Palethorpe
@ 2016-10-04 15:57 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2016-10-04 15:57 UTC (permalink / raw)
To: ltp
Hi!
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-04 15:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-30 14:42 [LTP] [PATCH] device-drivers/rtc: handle EINVAL on RTC_ALM_READ Richard Palethorpe
2016-10-04 15:57 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox