From 44588fb487e94e330e9ea9da744cb35e7f14dc96 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 16 Dec 2006 18:29:03 -0200 Subject: Several stuff backported from 2.6.19-git series From: Mauro Carvalho Chehab - INIT_WORK replaced by INIT_DELAYED_WORK - struct work_struct replaced by struct delayed_work - callback parameters also changed - SLAB_KERNEL replaced by GFP_KERNEL - linux/suspend.h replaced by linux/freezer.h - on cpia: INIT_WORK replaced by INIT_WORK_NAR - file->f_dentry->d_inode replaced by file->f_path.dentry->d_inode Signed-off-by: Mauro Carvalho Chehab --- .../drivers/media/video/pvrusb2/pvrusb2-context.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'linux/drivers/media/video/pvrusb2') diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c index f129f316d..19787dc81 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -45,16 +45,33 @@ static void pvr2_context_trigger_poll(struct pvr2_context *mp) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void pvr2_context_poll(struct pvr2_context *mp) +#else +static void pvr2_context_poll(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct pvr2_context *mp = + container_of(work, struct pvr2_context, workpoll); +#endif pvr2_context_enter(mp); do { pvr2_hdw_poll(mp->hdw); } while (0); pvr2_context_exit(mp); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void pvr2_context_setup(struct pvr2_context *mp) +#else +static void pvr2_context_setup(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct pvr2_context *mp = + container_of(work, struct pvr2_context, workinit); + +#endif pvr2_context_enter(mp); do { if (!pvr2_hdw_dev_ok(mp->hdw)) break; pvr2_hdw_setup(mp->hdw); @@ -92,8 +109,13 @@ struct pvr2_context *pvr2_context_create( } mp->workqueue = create_singlethread_workqueue("pvrusb2"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&mp->workinit,(void (*)(void*))pvr2_context_setup,mp); INIT_WORK(&mp->workpoll,(void (*)(void*))pvr2_context_poll,mp); +#else + INIT_WORK(&mp->workinit, pvr2_context_setup); + INIT_WORK(&mp->workpoll, pvr2_context_poll); +#endif queue_work(mp->workqueue,&mp->workinit); done: return mp; -- cgit v1.2.3