diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 2befa3819cdb..7874d9790a51 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -449,6 +449,14 @@ static int __devinit cx18_init_struct1(struct cx18 *cx) | |||
449 | 449 | ||
450 | spin_lock_init(&cx->lock); | 450 | spin_lock_init(&cx->lock); |
451 | 451 | ||
452 | cx->work_queue = create_singlethread_workqueue(cx->name); | ||
453 | if (cx->work_queue == NULL) { | ||
454 | CX18_ERR("Could not create work queue\n"); | ||
455 | return -1; | ||
456 | } | ||
457 | |||
458 | INIT_WORK(&cx->work, cx18_work_handler); | ||
459 | |||
452 | /* start counting open_id at 1 */ | 460 | /* start counting open_id at 1 */ |
453 | cx->open_id = 1; | 461 | cx->open_id = 1; |
454 | 462 | ||
@@ -831,6 +839,7 @@ free_map: | |||
831 | free_mem: | 839 | free_mem: |
832 | release_mem_region(cx->base_addr, CX18_MEM_SIZE); | 840 | release_mem_region(cx->base_addr, CX18_MEM_SIZE); |
833 | free_workqueue: | 841 | free_workqueue: |
842 | destroy_workqueue(cx->work_queue); | ||
834 | err: | 843 | err: |
835 | if (retval == 0) | 844 | if (retval == 0) |
836 | retval = -ENODEV; | 845 | retval = -ENODEV; |
@@ -931,6 +940,9 @@ static void cx18_remove(struct pci_dev *pci_dev) | |||
931 | 940 | ||
932 | cx18_halt_firmware(cx); | 941 | cx18_halt_firmware(cx); |
933 | 942 | ||
943 | flush_workqueue(cx->work_queue); | ||
944 | destroy_workqueue(cx->work_queue); | ||
945 | |||
934 | cx18_streams_cleanup(cx, 1); | 946 | cx18_streams_cleanup(cx, 1); |
935 | 947 | ||
936 | exit_cx18_i2c(cx); | 948 | exit_cx18_i2c(cx); |