summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-05 08:58:25 +0000
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-05 08:58:25 +0000
commitd72c129e9f3b79a248c91178052e75c429cfbc53 (patch)
treee0348c87c0bcfbbc07f0ea29ec57422746e376da
parent990c9e823d0db2e126fae7a2ead592ebd1ea2e6f (diff)
downloadmediapointer-dvb-s2-d72c129e9f3b79a248c91178052e75c429cfbc53.tar.gz
mediapointer-dvb-s2-d72c129e9f3b79a248c91178052e75c429cfbc53.tar.bz2
Compatibility layer for hrtimer API
From: Jean Delvare <khali@linux-fr.org> Kernels 2.6.22 to 2.6.24 (inclusive) need some compatibility quirks for the hrtimer API. For older kernels, some required functions were not exported so there's nothing we can do. This means that drivers using the hrtimer infrastructure will no longer work for kernels older than 2.6.22. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--v4l/compat.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 11dc57109..e73f03087 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -480,4 +480,23 @@ static inline unsigned long v4l_compat_fls(unsigned long x)
}
#endif
+/*
+ * Compatibility code for hrtimer API
+ * This will make hrtimer usable for kernels 2.6.22 and later.
+ * For earlier kernels, not all required functions are exported
+ * so there's nothing we can do.
+ */
+
+#ifdef _LINUX_HRTIMER_H
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) && \
+ LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
+/* Forward a hrtimer so it expires after the hrtimer's current now */
+static inline unsigned long hrtimer_forward_now(struct hrtimer *timer,
+ ktime_t interval)
+{
+ return hrtimer_forward(timer, timer->base->get_time(), interval);
+}
+#endif
+#endif /* _LINUX_HRTIMER_H */
+
#endif /* _COMPAT_H */