aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/rtc.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/rtc.txt')
-rw-r--r--Documentation/rtc.txt38
1 files changed, 19 insertions, 19 deletions
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 804a7cf6bd12..8deffcd68cb8 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -268,8 +268,8 @@ int main(int argc, char **argv)
268 /* This read will block */ 268 /* This read will block */
269 retval = read(fd, &data, sizeof(unsigned long)); 269 retval = read(fd, &data, sizeof(unsigned long));
270 if (retval == -1) { 270 if (retval == -1) {
271 perror("read"); 271 perror("read");
272 exit(errno); 272 exit(errno);
273 } 273 }
274 fprintf(stderr, " %d",i); 274 fprintf(stderr, " %d",i);
275 fflush(stderr); 275 fflush(stderr);
@@ -326,11 +326,11 @@ test_READ:
326 rtc_tm.tm_sec %= 60; 326 rtc_tm.tm_sec %= 60;
327 rtc_tm.tm_min++; 327 rtc_tm.tm_min++;
328 } 328 }
329 if (rtc_tm.tm_min == 60) { 329 if (rtc_tm.tm_min == 60) {
330 rtc_tm.tm_min = 0; 330 rtc_tm.tm_min = 0;
331 rtc_tm.tm_hour++; 331 rtc_tm.tm_hour++;
332 } 332 }
333 if (rtc_tm.tm_hour == 24) 333 if (rtc_tm.tm_hour == 24)
334 rtc_tm.tm_hour = 0; 334 rtc_tm.tm_hour = 0;
335 335
336 retval = ioctl(fd, RTC_ALM_SET, &rtc_tm); 336 retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
@@ -407,8 +407,8 @@ test_PIE:
407 "\n...Periodic IRQ rate is fixed\n"); 407 "\n...Periodic IRQ rate is fixed\n");
408 goto done; 408 goto done;
409 } 409 }
410 perror("RTC_IRQP_SET ioctl"); 410 perror("RTC_IRQP_SET ioctl");
411 exit(errno); 411 exit(errno);
412 } 412 }
413 413
414 fprintf(stderr, "\n%ldHz:\t", tmp); 414 fprintf(stderr, "\n%ldHz:\t", tmp);
@@ -417,27 +417,27 @@ test_PIE:
417 /* Enable periodic interrupts */ 417 /* Enable periodic interrupts */
418 retval = ioctl(fd, RTC_PIE_ON, 0); 418 retval = ioctl(fd, RTC_PIE_ON, 0);
419 if (retval == -1) { 419 if (retval == -1) {
420 perror("RTC_PIE_ON ioctl"); 420 perror("RTC_PIE_ON ioctl");
421 exit(errno); 421 exit(errno);
422 } 422 }
423 423
424 for (i=1; i<21; i++) { 424 for (i=1; i<21; i++) {
425 /* This blocks */ 425 /* This blocks */
426 retval = read(fd, &data, sizeof(unsigned long)); 426 retval = read(fd, &data, sizeof(unsigned long));
427 if (retval == -1) { 427 if (retval == -1) {
428 perror("read"); 428 perror("read");
429 exit(errno); 429 exit(errno);
430 } 430 }
431 fprintf(stderr, " %d",i); 431 fprintf(stderr, " %d",i);
432 fflush(stderr); 432 fflush(stderr);
433 irqcount++; 433 irqcount++;
434 } 434 }
435 435
436 /* Disable periodic interrupts */ 436 /* Disable periodic interrupts */
437 retval = ioctl(fd, RTC_PIE_OFF, 0); 437 retval = ioctl(fd, RTC_PIE_OFF, 0);
438 if (retval == -1) { 438 if (retval == -1) {
439 perror("RTC_PIE_OFF ioctl"); 439 perror("RTC_PIE_OFF ioctl");
440 exit(errno); 440 exit(errno);
441 } 441 }
442 } 442 }
443 443