projects
/
walkera0701-joystick
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88ff302
)
Check for timer resolution before start
author
Peter Popovec
<popovec@fei.tuke.sk>
Wed, 22 Oct 2008 09:22:01 +0000
(11:22 +0200)
committer
Peter Popovec
<popovec@fei.tuke.sk>
Sat, 25 Oct 2008 07:08:03 +0000
(09:08 +0200)
walkera0701.c
patch
|
blob
|
history
diff --git
a/walkera0701.c
b/walkera0701.c
index adb0d144957f051663a3a3d35eea8d02c452e1b6..ec8c344249635dcf7cbca2247e210376db3f0f90 100644
(file)
--- 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);