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 --- linux/drivers/media/dvb/b2c2/flexcop-pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'linux/drivers/media/dvb/b2c2') diff --git a/linux/drivers/media/dvb/b2c2/flexcop-pci.c b/linux/drivers/media/dvb/b2c2/flexcop-pci.c index e6362f304..648f319b2 100644 --- a/linux/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/linux/drivers/media/dvb/b2c2/flexcop-pci.c @@ -63,7 +63,11 @@ struct flexcop_pci { unsigned long last_irq; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct work_struct irq_check_work; +#else + struct delayed_work irq_check_work; +#endif struct flexcop_device *fc_dev; }; @@ -97,9 +101,18 @@ static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_regi return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void flexcop_pci_irq_check_work(void *data) +#else +static void flexcop_pci_irq_check_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct flexcop_pci *fc_pci = data; +#else + struct flexcop_pci *fc_pci = + container_of(work, struct flexcop_pci, irq_check_work.work); +#endif struct flexcop_device *fc = fc_pci->fc_dev; flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); @@ -375,7 +388,11 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e if ((ret = flexcop_pci_dma_init(fc_pci)) != 0) goto err_fc_exit; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work, fc_pci); +#else + INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); +#endif return ret; -- cgit v1.2.3