From 7b7b6e145e1bf05cdf3e5d82e8f30b288ad9e15a Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 17 Jul 2008 16:48:19 +0200 Subject: videodev/dabusb/dvbdev: fix 2.6.16 compilation From: Hans Verkuil struct file_operations was made const in 2.6.17. Cast const away when compiling under 2.6.16. Signed-off-by: Hans Verkuil --- v4l/compat.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'v4l/compat.h') diff --git a/v4l/compat.h b/v4l/compat.h index ba9a7cff7..af6727e1b 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -170,8 +170,11 @@ static inline struct proc_dir_entry *proc_create(const char *a, e = create_proc_entry(a, b, c); if (e) { e->owner = THIS_MODULE; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) e->proc_fops = d; - +#else + e->proc_fops = (struct file_operations *)d; +#endif } return e; } @@ -189,7 +192,11 @@ static inline struct proc_dir_entry *proc_create_data(const char *a, e = create_proc_entry(a, b, c); if (e) { e->owner = THIS_MODULE; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) e->proc_fops = d; +#else + e->proc_fops = (struct file_operations *)d; +#endif e->data = f; } return e; @@ -197,6 +204,10 @@ static inline struct proc_dir_entry *proc_create_data(const char *a, #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) +#define hweight64(x) generic_hweight64(x) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) #define div64_u64(a,b) div64_64(a,b) -- cgit v1.2.3