Skip to content

Commit 4db26f9

Browse files
ldoktorShuah Khan
authored andcommitted
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: Lukáš Doktor <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 86db9a1 commit 4db26f9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/testing/selftests/timers/rtctest.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ int main(int argc, char **argv)
221221
/* Read the current alarm settings */
222222
retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
223223
if (retval == -1) {
224+
if (errno == EINVAL) {
225+
fprintf(stderr,
226+
"\n...EINVAL reading current alarm setting.\n");
227+
goto test_PIE;
228+
}
224229
perror("RTC_ALM_READ ioctl");
225230
exit(errno);
226231
}
@@ -231,7 +236,7 @@ int main(int argc, char **argv)
231236
/* Enable alarm interrupts */
232237
retval = ioctl(fd, RTC_AIE_ON, 0);
233238
if (retval == -1) {
234-
if (errno == EINVAL) {
239+
if (errno == EINVAL || errno == EIO) {
235240
fprintf(stderr,
236241
"\n...Alarm IRQs not supported.\n");
237242
goto test_PIE;

0 commit comments

Comments
 (0)