From c17147292dba706cda92a6835e11cbf25e847da0 Mon Sep 17 00:00:00 2001 From: Peter Popovec Date: Wed, 22 Oct 2008 11:22:01 +0200 Subject: [PATCH] Check for timer resolution before start --- walkera0701.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/walkera0701.c b/walkera0701.c index adb0d14..ec8c344 100644 --- a/walkera0701.c +++ b/walkera0701.c @@ -311,6 +311,12 @@ static int walkera0701_connect(int parport) static int __init walkera0701_init(void) { + struct timespec tp; + hrtimer_get_res(CLOCK_MONOTONIC, &tp); + if (tp.tv_sec != 0 || tp.tv_nsec > (BIN0_PULSE / 2)) { + printk(KERN_ERR "walkera0701: timer resolution out of range\n"); + return (EFAULT); + } hrtimer_init(&walkera0701_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); walkera0701_timer.function = walkera0701_timer_handler; return walkera0701_connect(walkera0701_pp_no); -- 2.39.5