diff options
Diffstat (limited to 'v4l/compat.h')
-rw-r--r-- | v4l/compat.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index ea7d49acf..04950ea74 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -533,6 +533,8 @@ do { \ le16_to_cpu(get_unaligned((unsigned short *)(a))) #define put_unaligned_le16(r, a) \ put_unaligned(cpu_to_le16(r), ((unsigned short *)(a))) +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) #ifdef CONFIG_PROC_FS static inline struct proc_dir_entry *proc_create(const char *a, mode_t b, struct proc_dir_entry *c, const struct file_operations *d) @@ -547,7 +549,33 @@ static inline struct proc_dir_entry *proc_create(const char *a, } return e; } + +static inline struct proc_dir_entry *proc_create_data(const char *a, + mode_t b, struct proc_dir_entry *c, const struct file_operations *d, + void *f) +{ + struct proc_dir_entry *e; + + e = create_proc_entry(a, b, c); + if (e) { + e->owner = THIS_MODULE; + e->proc_fops = d; + e->data = f; + } + return e; +} +#endif #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#define div64_u64(a,b) div64_64(a,b) + +#define clamp( x, l, h ) max_t( __typeof__( x ), \ + ( l ), \ + min_t( __typeof__( x ), \ + ( h ), \ + ( x ) ) ) + #endif #endif |