From 970c5905cb9c2f7613ceb203591cd3862d0df53e Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Wed, 9 Nov 2005 21:54:53 +0000 Subject: Fix backward kernel compatibity (nothing for upstream) From: Tyler Trafford Signed-off-by: Nickolay V. Shmyrev --- linux/drivers/media/video/saa7134/saa7134-oss.c | 16 +++++++++++++--- v4l/ChangeLog | 11 +++++++++++ v4l/compat.h | 8 +++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/linux/drivers/media/video/saa7134/saa7134-oss.c b/linux/drivers/media/video/saa7134/saa7134-oss.c index 629ad73be..2ceb1c4c6 100644 --- a/linux/drivers/media/video/saa7134/saa7134-oss.c +++ b/linux/drivers/media/video/saa7134/saa7134-oss.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-oss.c,v 1.25 2005/11/09 19:36:11 rmcc Exp $ + * $Id: saa7134-oss.c,v 1.26 2005/11/09 21:54:53 nsh Exp $ * * device driver for philips saa7134 based TV cards * oss dsp interface @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -49,11 +50,20 @@ MODULE_PARM_DESC(rate,"sample rate (valid are: 32000,48000)"); static unsigned int dsp_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; MODULE_PARM_DESC(dsp_nr, "device numbers for SAA7134 capture interface(s)."); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +static int dummy; +module_param_array(dsp_nr, int, dummy, 0444); +#else module_param_array(dsp_nr, int, NULL, 0444); +#endif static unsigned int mixer_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET }; MODULE_PARM_DESC(mixer_nr, "mixer numbers for SAA7134 capture interface(s)."); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +module_param_array(mixer_nr, int, dummy, 0444); +#else module_param_array(mixer_nr, int, NULL, 0444); +#endif #define dprintk(fmt, arg...) if (debug) \ printk(KERN_DEBUG "%s/oss: " fmt, dev->name , ## arg) @@ -907,7 +917,7 @@ int saa7134_dsp_create(struct saa7134_dev *dev) err = dev->dmasound.minor_dsp = register_sound_dsp(&saa7134_dsp_fops, - dsp_nr[dev->nr]); + dsp_nr[dev->nr]); if (err < 0) { goto fail; } @@ -916,7 +926,7 @@ int saa7134_dsp_create(struct saa7134_dev *dev) err = dev->dmasound.minor_mixer = register_sound_mixer(&saa7134_mixer_fops, - mixer_nr[dev->nr]); + mixer_nr[dev->nr]); if (err < 0) goto fail; printk(KERN_INFO "%s: registered device mixer%d\n", diff --git a/v4l/ChangeLog b/v4l/ChangeLog index 6c5ebbf91..b5851e16e 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,14 @@ +2005-11-09 21:51 nshmyrev + + * ../linux/drivers/media/video/saa7134/saa7134-oss.c: + (saa7134_dsp_create): + * ../v4l/compat.h: + + - Fix backward kernel compatibity. + + Thanks-to: Tyler Trafford + Signed-off-by: Nickolay V. Shmyrev + 2005-11-09 19:15 trafford * ../linux/driver/media/video/cx25840/cx25840-firmware.c: diff --git a/v4l/compat.h b/v4l/compat.h index d13fe010c..94ff08586 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -1,5 +1,5 @@ /* - * $Id: compat.h,v 1.30 2005/11/08 17:46:27 nsh Exp $ + * $Id: compat.h,v 1.31 2005/11/09 21:54:53 nsh Exp $ */ #ifndef _COMPAT_H @@ -201,6 +201,7 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) return page_to_pfn(vmalloc_to_page(vmalloc_addr)); } +#ifndef wait_event_timeout #define wait_event_timeout(wq, condition, timeout) \ ({ \ long __ret = timeout; \ @@ -219,12 +220,14 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) } while (0); \ __ret; \ }) +#endif #define remap_pfn_range remap_page_range #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) +#ifndef kcalloc #define kcalloc(n,size,flags) \ ({ \ void * __ret = NULL; \ @@ -234,8 +237,10 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) __ret; \ }) #endif +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) +#ifndef kzalloc #define kzalloc(size, flags) \ ({ \ void *__ret = kmalloc(size, flags); \ @@ -244,6 +249,7 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) __ret; \ }) #endif +#endif #endif /* -- cgit v1.2.3