diff options
author | Andy Walls <awalls@radix.net> | 2008-11-25 20:02:45 -0500 |
---|---|---|
committer | Andy Walls <awalls@radix.net> | 2008-11-25 20:02:45 -0500 |
commit | 96b9b00e9e8f7771c45723ec0c869db9f2260585 (patch) | |
tree | 0d8ed92f65b82f6dee32acab1bbcd67b58f67917 /linux/drivers/media/video | |
parent | 53397dd1cc3dab09ffcc5805bfa3c22c09b567fc (diff) | |
download | mediapointer-dvb-s2-96b9b00e9e8f7771c45723ec0c869db9f2260585.tar.gz mediapointer-dvb-s2-96b9b00e9e8f7771c45723ec0c869db9f2260585.tar.bz2 |
cx18: Change work_queue teardown to work for kernels earlier than 2.6.22
From: Andy Walls <awalls@radix.net>
For kernels earlier than 2.6.22, we can't cancel work, so we have to flush the
work queue to completion before destroying it.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/cx18/cx18-driver.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-driver.c b/linux/drivers/media/video/cx18/cx18-driver.c index 198fdf9a6..57fcce84b 100644 --- a/linux/drivers/media/video/cx18/cx18-driver.c +++ b/linux/drivers/media/video/cx18/cx18-driver.c @@ -918,6 +918,7 @@ int cx18_init_on_first_open(struct cx18 *cx) return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) static void cx18_cancel_epu_work_orders(struct cx18 *cx) { int i; @@ -925,6 +926,7 @@ static void cx18_cancel_epu_work_orders(struct cx18 *cx) cancel_work_sync(&cx->epu_work_order[i].work); } +#endif static void cx18_remove(struct pci_dev *pci_dev) { struct cx18 *cx = pci_get_drvdata(pci_dev); @@ -938,11 +940,20 @@ static void cx18_remove(struct pci_dev *pci_dev) /* Interrupts */ cx18_sw1_irq_disable(cx, IRQ_CPU_TO_EPU | IRQ_APU_TO_EPU); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) cx18_sw2_irq_disable(cx, IRQ_CPU_TO_EPU_ACK | IRQ_APU_TO_EPU_ACK); cx18_halt_firmware(cx); cx18_cancel_epu_work_orders(cx); +#else + + flush_workqueue(cx->work_queue); + + cx18_sw2_irq_disable(cx, IRQ_CPU_TO_EPU_ACK | IRQ_APU_TO_EPU_ACK); + + cx18_halt_firmware(cx); +#endif destroy_workqueue(cx->work_queue); |