summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 3df844c87..8e778d7f5 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -11,6 +11,7 @@
* delayed_work in the same context as something named work_struct. */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
#define delayed_work work_struct
+#define INIT_DELAYED_WORK(a,b,c) INIT_WORK(a,b,c)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
@@ -238,6 +239,12 @@ static inline int list_is_singular(const struct list_head *head)
min_t( __typeof__( x ), \
( h ), \
( x ) ) )
+#define clamp_val(val, min, max) ({ \
+ typeof(val) __val = (val); \
+ typeof(val) __min = (min); \
+ typeof(val) __max = (max); \
+ __val = __val < __min ? __min : __val; \
+ __val > __max ? __max : __val; })
#endif
#ifdef NEED_ALGO_CONTROL