Commit 4db26f9e authored by Lukáš Doktor's avatar Lukáš Doktor Committed by Shuah Khan

rtc: rtctest: Improve support detection

The rtc-generic and opal-rtc are failing to run this test as they do not
support all the features. Let's treat the error returns and skip to the
following test.

Theoretically the test_DATE should be also adjusted, but as it's enabled
on demand I think it makes sense to fail in such case.
Signed-off-by: default avatarLukáš Doktor <ldoktor@redhat.com>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 86db9a11
...@@ -221,6 +221,11 @@ int main(int argc, char **argv) ...@@ -221,6 +221,11 @@ int main(int argc, char **argv)
/* Read the current alarm settings */ /* Read the current alarm settings */
retval = ioctl(fd, RTC_ALM_READ, &rtc_tm); retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
if (retval == -1) { if (retval == -1) {
if (errno == EINVAL) {
fprintf(stderr,
"\n...EINVAL reading current alarm setting.\n");
goto test_PIE;
}
perror("RTC_ALM_READ ioctl"); perror("RTC_ALM_READ ioctl");
exit(errno); exit(errno);
} }
...@@ -231,7 +236,7 @@ int main(int argc, char **argv) ...@@ -231,7 +236,7 @@ int main(int argc, char **argv)
/* Enable alarm interrupts */ /* Enable alarm interrupts */
retval = ioctl(fd, RTC_AIE_ON, 0); retval = ioctl(fd, RTC_AIE_ON, 0);
if (retval == -1) { if (retval == -1) {
if (errno == EINVAL) { if (errno == EINVAL || errno == EIO) {
fprintf(stderr, fprintf(stderr,
"\n...Alarm IRQs not supported.\n"); "\n...Alarm IRQs not supported.\n");
goto test_PIE; goto test_PIE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment