From 863e6bd467176febc73a46effb75f3969d87413d Mon Sep 17 00:00:00 2001 From: Hartmut Hackmann Date: Thu, 15 Feb 2007 01:23:08 +0100 Subject: saa7134 2.6.20 compat patch From: Markus Rechberger saa7134 2.6.20 compat patch Signed-off-by: Markus Rechberger Signed-off-by: Hartmut Hackmann --- linux/drivers/media/video/saa7134/saa7134-core.c | 18 +++++++++++++----- linux/drivers/media/video/saa7134/saa7134.h | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 194ad5a3f..ef1b8d7a1 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -257,10 +257,14 @@ static void request_submodules(struct saa7134_dev *dev){ request_module("saa7134-oss"); } #else -static struct work_struct request_module_wk; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void request_module_async(void *ptr){ - struct saa7134_dev *dev=(struct saa7134_dev*)ptr; + struct saa7134_dev* dev=(struct saa7134_dev*)ptr; +#else +static void request_module_async(struct work_struct *work){ + struct saa7134_dev* dev = container_of(work, struct saa7134_dev, request_module_wk); +#endif if (card_is_empress(dev)) request_module("saa7134-empress"); if (card_is_dvb(dev)) @@ -273,13 +277,17 @@ static void request_module_async(void *ptr){ static void request_submodules(struct saa7134_dev *dev) { - INIT_WORK(&request_module_wk, request_module_async, dev); - schedule_work(&request_module_wk); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + INIT_WORK(&dev->request_module_wk, request_module_async, (void*)dev); +#else + INIT_WORK(&dev->request_module_wk, request_module_async); +#endif + schedule_work(&dev->request_module_wk); } #endif #else -#define request_module_depend(name) +#define request_submodules() #endif /* CONFIG_MODULES */ /* ------------------------------------------------------------------ */ diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index 9742d318b..5d89e21f8 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -464,6 +464,8 @@ struct saa7134_dev { #ifdef VIDIOC_G_PRIORITY struct v4l2_prio_state prio; #endif + /* workstruct for loading modules */ + struct work_struct request_module_wk; /* insmod option/autodetected */ int autodetected; -- cgit v1.2.3