From: Richard Palethorpe <rpalethorpe@suse.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] device-drivers/rtc: handle EINVAL on RTC_ALM_READ
Date: Fri, 30 Sep 2016 16:42:06 +0200 [thread overview]
Message-ID: <20160930164206.7f2b6f8e@linux-v3j5> (raw)
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
next reply other threads:[~2016-09-30 14:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 14:42 Richard Palethorpe [this message]
2016-10-04 15:57 ` [LTP] [PATCH] device-drivers/rtc: handle EINVAL on RTC_ALM_READ Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160930164206.7f2b6f8e@linux-v3j5 \
--to=rpalethorpe@suse.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.