diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 7a1a7830a6b3..7874d9790a51 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -448,7 +448,14 @@ static int __devinit cx18_init_struct1(struct cx18 *cx) | |||
448 | mutex_init(&cx->gpio_lock); | 448 | mutex_init(&cx->gpio_lock); |
449 | 449 | ||
450 | spin_lock_init(&cx->lock); | 450 | spin_lock_init(&cx->lock); |
451 | spin_lock_init(&cx->dma_reg_lock); | 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); | ||
452 | 459 | ||
453 | /* start counting open_id at 1 */ | 460 | /* start counting open_id at 1 */ |
454 | cx->open_id = 1; | 461 | cx->open_id = 1; |
@@ -581,10 +588,10 @@ static void cx18_load_and_init_modules(struct cx18 *cx) | |||
581 | 588 | ||
582 | #ifdef MODULE | 589 | #ifdef MODULE |
583 | /* load modules */ | 590 | /* load modules */ |
584 | #ifndef CONFIG_MEDIA_TUNER | 591 | #ifdef CONFIG_MEDIA_TUNER_MODULE |
585 | hw = cx18_request_module(cx, hw, "tuner", CX18_HW_TUNER); | 592 | hw = cx18_request_module(cx, hw, "tuner", CX18_HW_TUNER); |
586 | #endif | 593 | #endif |
587 | #ifndef CONFIG_VIDEO_CS5345 | 594 | #ifdef CONFIG_VIDEO_CS5345_MODULE |
588 | hw = cx18_request_module(cx, hw, "cs5345", CX18_HW_CS5345); | 595 | hw = cx18_request_module(cx, hw, "cs5345", CX18_HW_CS5345); |
589 | #endif | 596 | #endif |
590 | #endif | 597 | #endif |
@@ -832,6 +839,7 @@ free_map: | |||
832 | free_mem: | 839 | free_mem: |
833 | release_mem_region(cx->base_addr, CX18_MEM_SIZE); | 840 | release_mem_region(cx->base_addr, CX18_MEM_SIZE); |
834 | free_workqueue: | 841 | free_workqueue: |
842 | destroy_workqueue(cx->work_queue); | ||
835 | err: | 843 | err: |
836 | if (retval == 0) | 844 | if (retval == 0) |
837 | retval = -ENODEV; | 845 | retval = -ENODEV; |
@@ -932,6 +940,9 @@ static void cx18_remove(struct pci_dev *pci_dev) | |||
932 | 940 | ||
933 | cx18_halt_firmware(cx); | 941 | cx18_halt_firmware(cx); |
934 | 942 | ||
943 | flush_workqueue(cx->work_queue); | ||
944 | destroy_workqueue(cx->work_queue); | ||
945 | |||
935 | cx18_streams_cleanup(cx, 1); | 946 | cx18_streams_cleanup(cx, 1); |
936 | 947 | ||
937 | exit_cx18_i2c(cx); | 948 | exit_cx18_i2c(cx); |