summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-16 11:47:49 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-16 11:47:49 -0300
commitaa9dfaad8a8449fcfe595af20993b86e23c4be22 (patch)
tree1478efb8c7421c3128f0d98beb0728bb6d217090 /v4l
parent1eb5c90687e833327fe2607cb1350221b335f34a (diff)
downloadmediapointer-dvb-s2-aa9dfaad8a8449fcfe595af20993b86e23c4be22.tar.gz
mediapointer-dvb-s2-aa9dfaad8a8449fcfe595af20993b86e23c4be22.tar.bz2
Building system: fix compilation against non-linux-next kernels
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/compat.h38
1 files changed, 33 insertions, 5 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 257143a6b..ea7d49acf 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -14,6 +14,13 @@
#include <linux/i2c-dev.h>
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
+#ifdef CONFIG_PROC_FS
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#endif
+#endif
+
/* To allow alsa code to work */
#ifdef NEED_SOUND_DRIVER_H
#include <sound/driver.h>
@@ -517,9 +524,30 @@ do { \
.bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
+#define get_unaligned_be16(a) \
+ be16_to_cpu(get_unaligned((unsigned short *)(a)))
+#define put_unaligned_be16(r, a) \
+ put_unaligned(cpu_to_be16(r), ((unsigned short *)(a)))
+#define get_unaligned_le16(a) \
+ le16_to_cpu(get_unaligned((unsigned short *)(a)))
+#define put_unaligned_le16(r, a) \
+ put_unaligned(cpu_to_le16(r), ((unsigned short *)(a)))
+#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)
+{
+ struct proc_dir_entry *e;
+
+ e = create_proc_entry(a, b, c);
+ if (e) {
+ e->owner = THIS_MODULE;
+ e->proc_fops = d;
+
+ }
+ return e;
+}
+#endif
+#endif
+
#endif
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */