aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c9
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c5
-rw-r--r--drivers/media/video/cx18/cx18-driver.c8
-rw-r--r--drivers/media/video/cx231xx/cx231xx-cards.c8
-rw-r--r--drivers/media/video/cx23885/cx23885-input.c2
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c8
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c8
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c2
-rw-r--r--drivers/media/video/omap24xxcam.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c11
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c2
11 files changed, 56 insertions, 13 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 849cd170b821..91399c94cd18 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -189,8 +189,14 @@ static void request_modules(struct bttv *dev)
189 INIT_WORK(&dev->request_module_wk, request_module_async); 189 INIT_WORK(&dev->request_module_wk, request_module_async);
190 schedule_work(&dev->request_module_wk); 190 schedule_work(&dev->request_module_wk);
191} 191}
192
193static void flush_request_modules(struct bttv *dev)
194{
195 flush_work_sync(&dev->request_module_wk);
196}
192#else 197#else
193#define request_modules(dev) 198#define request_modules(dev)
199#define flush_request_modules(dev)
194#endif /* CONFIG_MODULES */ 200#endif /* CONFIG_MODULES */
195 201
196 202
@@ -4429,6 +4435,9 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
4429 if (bttv_verbose) 4435 if (bttv_verbose)
4430 printk("bttv%d: unloading\n",btv->c.nr); 4436 printk("bttv%d: unloading\n",btv->c.nr);
4431 4437
4438 if (bttv_tvcards[btv->c.type].has_dvb)
4439 flush_request_modules(btv);
4440
4432 /* shutdown everything (DMA+IRQs) */ 4441 /* shutdown everything (DMA+IRQs) */
4433 btand(~15, BT848_GPIO_DMA_CTL); 4442 btand(~15, BT848_GPIO_DMA_CTL);
4434 btwrite(0, BT848_INT_MASK); 4443 btwrite(0, BT848_INT_MASK);
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 97793b960600..e8b64bca9db2 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -319,16 +319,13 @@ static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir)
319 319
320static void bttv_ir_stop(struct bttv *btv) 320static void bttv_ir_stop(struct bttv *btv)
321{ 321{
322 if (btv->remote->polling) { 322 if (btv->remote->polling)
323 del_timer_sync(&btv->remote->timer); 323 del_timer_sync(&btv->remote->timer);
324 flush_scheduled_work();
325 }
326 324
327 if (btv->remote->rc5_gpio) { 325 if (btv->remote->rc5_gpio) {
328 u32 gpio; 326 u32 gpio;
329 327
330 del_timer_sync(&btv->remote->timer); 328 del_timer_sync(&btv->remote->timer);
331 flush_scheduled_work();
332 329
333 gpio = bttv_gpio_read(&btv->c); 330 gpio = bttv_gpio_read(&btv->c);
334 bttv_gpio_write(&btv->c, gpio & ~(1 << 4)); 331 bttv_gpio_write(&btv->c, gpio & ~(1 << 4));
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 676e5bef89eb..133ec2bac180 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -267,8 +267,14 @@ static void request_modules(struct cx18 *dev)
267 INIT_WORK(&dev->request_module_wk, request_module_async); 267 INIT_WORK(&dev->request_module_wk, request_module_async);
268 schedule_work(&dev->request_module_wk); 268 schedule_work(&dev->request_module_wk);
269} 269}
270
271static void flush_request_modules(struct cx18 *dev)
272{
273 flush_work_sync(&dev->request_module_wk);
274}
270#else 275#else
271#define request_modules(dev) 276#define request_modules(dev)
277#define flush_request_modules(dev)
272#endif /* CONFIG_MODULES */ 278#endif /* CONFIG_MODULES */
273 279
274/* Generic utility functions */ 280/* Generic utility functions */
@@ -1233,6 +1239,8 @@ static void cx18_remove(struct pci_dev *pci_dev)
1233 1239
1234 CX18_DEBUG_INFO("Removing Card\n"); 1240 CX18_DEBUG_INFO("Removing Card\n");
1235 1241
1242 flush_request_modules(cx);
1243
1236 /* Stop all captures */ 1244 /* Stop all captures */
1237 CX18_DEBUG_INFO("Stopping all streams\n"); 1245 CX18_DEBUG_INFO("Stopping all streams\n");
1238 if (atomic_read(&cx->tot_capturing) > 0) 1246 if (atomic_read(&cx->tot_capturing) > 0)
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 6905607ffca3..588f3e8f028b 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -813,8 +813,14 @@ static void request_modules(struct cx231xx *dev)
813 INIT_WORK(&dev->request_module_wk, request_module_async); 813 INIT_WORK(&dev->request_module_wk, request_module_async);
814 schedule_work(&dev->request_module_wk); 814 schedule_work(&dev->request_module_wk);
815} 815}
816
817static void flush_request_modules(struct cx231xx *dev)
818{
819 flush_work_sync(&dev->request_module_wk);
820}
816#else 821#else
817#define request_modules(dev) 822#define request_modules(dev)
823#define flush_request_modules(dev)
818#endif /* CONFIG_MODULES */ 824#endif /* CONFIG_MODULES */
819 825
820/* 826/*
@@ -1147,6 +1153,8 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
1147 if (!dev->udev) 1153 if (!dev->udev)
1148 return; 1154 return;
1149 1155
1156 flush_request_modules(dev);
1157
1150 /* delete v4l2 device */ 1158 /* delete v4l2 device */
1151 v4l2_device_unregister(&dev->v4l2_dev); 1159 v4l2_device_unregister(&dev->v4l2_dev);
1152 1160
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index 0b0d0664382a..199b9964bbe5 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -229,8 +229,6 @@ static void cx23885_input_ir_stop(struct cx23885_dev *dev)
229 v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params); 229 v4l2_subdev_call(dev->sd_ir, ir, rx_s_parameters, &params);
230 v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, &params); 230 v4l2_subdev_call(dev->sd_ir, ir, rx_g_parameters, &params);
231 } 231 }
232
233 flush_scheduled_work();
234} 232}
235 233
236static void cx23885_input_ir_close(struct rc_dev *rc) 234static void cx23885_input_ir_close(struct rc_dev *rc)
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index f7d71acbb078..addf9545e9bf 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -66,8 +66,14 @@ static void request_modules(struct cx8802_dev *dev)
66 INIT_WORK(&dev->request_module_wk, request_module_async); 66 INIT_WORK(&dev->request_module_wk, request_module_async);
67 schedule_work(&dev->request_module_wk); 67 schedule_work(&dev->request_module_wk);
68} 68}
69
70static void flush_request_modules(struct cx8802_dev *dev)
71{
72 flush_work_sync(&dev->request_module_wk);
73}
69#else 74#else
70#define request_modules(dev) 75#define request_modules(dev)
76#define flush_request_modules(dev)
71#endif /* CONFIG_MODULES */ 77#endif /* CONFIG_MODULES */
72 78
73 79
@@ -819,6 +825,8 @@ static void __devexit cx8802_remove(struct pci_dev *pci_dev)
819 825
820 dprintk( 1, "%s\n", __func__); 826 dprintk( 1, "%s\n", __func__);
821 827
828 flush_request_modules(dev);
829
822 if (!list_empty(&dev->drvlist)) { 830 if (!list_empty(&dev->drvlist)) {
823 struct cx8802_driver *drv, *tmp; 831 struct cx8802_driver *drv, *tmp;
824 int err; 832 int err;
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 8af302b425b3..099d5df8c572 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2690,8 +2690,14 @@ static void request_modules(struct em28xx *dev)
2690 INIT_WORK(&dev->request_module_wk, request_module_async); 2690 INIT_WORK(&dev->request_module_wk, request_module_async);
2691 schedule_work(&dev->request_module_wk); 2691 schedule_work(&dev->request_module_wk);
2692} 2692}
2693
2694static void flush_request_modules(struct em28xx *dev)
2695{
2696 flush_work_sync(&dev->request_module_wk);
2697}
2693#else 2698#else
2694#define request_modules(dev) 2699#define request_modules(dev)
2700#define flush_request_modules(dev)
2695#endif /* CONFIG_MODULES */ 2701#endif /* CONFIG_MODULES */
2696 2702
2697/* 2703/*
@@ -3118,6 +3124,8 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
3118 3124
3119 em28xx_info("disconnecting %s\n", dev->vdev->name); 3125 em28xx_info("disconnecting %s\n", dev->vdev->name);
3120 3126
3127 flush_request_modules(dev);
3128
3121 /* wait until all current v4l2 io is finished then deallocate 3129 /* wait until all current v4l2 io is finished then deallocate
3122 resources */ 3130 resources */
3123 mutex_lock(&dev->lock); 3131 mutex_lock(&dev->lock);
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 29cc74441a7d..ba1ba8648c81 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -551,7 +551,7 @@ void em28xx_deregister_snapshot_button(struct em28xx *dev)
551{ 551{
552 if (dev->sbutton_input_dev != NULL) { 552 if (dev->sbutton_input_dev != NULL) {
553 em28xx_info("Deregistering snapshot button\n"); 553 em28xx_info("Deregistering snapshot button\n");
554 cancel_rearming_delayed_work(&dev->sbutton_query_work); 554 cancel_delayed_work_sync(&dev->sbutton_query_work);
555 input_unregister_device(dev->sbutton_input_dev); 555 input_unregister_device(dev->sbutton_input_dev);
556 dev->sbutton_input_dev = NULL; 556 dev->sbutton_input_dev = NULL;
557 } 557 }
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 378b094aff16..017552762902 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1198,7 +1198,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
1198 1198
1199 atomic_inc(&cam->reset_disable); 1199 atomic_inc(&cam->reset_disable);
1200 1200
1201 flush_scheduled_work(); 1201 flush_work_sync(&cam->sensor_reset_work);
1202 1202
1203 rval = videobuf_streamoff(q); 1203 rval = videobuf_streamoff(q);
1204 if (!rval) { 1204 if (!rval) {
@@ -1512,7 +1512,7 @@ static int omap24xxcam_release(struct file *file)
1512 1512
1513 atomic_inc(&cam->reset_disable); 1513 atomic_inc(&cam->reset_disable);
1514 1514
1515 flush_scheduled_work(); 1515 flush_work_sync(&cam->sensor_reset_work);
1516 1516
1517 /* stop streaming capture */ 1517 /* stop streaming capture */
1518 videobuf_streamoff(&fh->vbq); 1518 videobuf_streamoff(&fh->vbq);
@@ -1536,7 +1536,7 @@ static int omap24xxcam_release(struct file *file)
1536 * not be scheduled anymore since streaming is already 1536 * not be scheduled anymore since streaming is already
1537 * disabled.) 1537 * disabled.)
1538 */ 1538 */
1539 flush_scheduled_work(); 1539 flush_work_sync(&cam->sensor_reset_work);
1540 1540
1541 mutex_lock(&cam->mutex); 1541 mutex_lock(&cam->mutex);
1542 if (atomic_dec_return(&cam->users) == 0) { 1542 if (atomic_dec_return(&cam->users) == 0) {
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 756a27812260..6abeecff6da7 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -166,8 +166,14 @@ static void request_submodules(struct saa7134_dev *dev)
166 schedule_work(&dev->request_module_wk); 166 schedule_work(&dev->request_module_wk);
167} 167}
168 168
169static void flush_request_submodules(struct saa7134_dev *dev)
170{
171 flush_work_sync(&dev->request_module_wk);
172}
173
169#else 174#else
170#define request_submodules(dev) 175#define request_submodules(dev)
176#define flush_request_submodules(dev)
171#endif /* CONFIG_MODULES */ 177#endif /* CONFIG_MODULES */
172 178
173/* ------------------------------------------------------------------ */ 179/* ------------------------------------------------------------------ */
@@ -1010,8 +1016,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1010 } 1016 }
1011 } 1017 }
1012 1018
1013 request_submodules(dev);
1014
1015 v4l2_prio_init(&dev->prio); 1019 v4l2_prio_init(&dev->prio);
1016 1020
1017 mutex_lock(&saa7134_devlist_lock); 1021 mutex_lock(&saa7134_devlist_lock);
@@ -1066,6 +1070,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1066 if (saa7134_dmasound_init && !dev->dmasound.priv_data) 1070 if (saa7134_dmasound_init && !dev->dmasound.priv_data)
1067 saa7134_dmasound_init(dev); 1071 saa7134_dmasound_init(dev);
1068 1072
1073 request_submodules(dev);
1069 return 0; 1074 return 0;
1070 1075
1071 fail4: 1076 fail4:
@@ -1091,6 +1096,8 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
1091 struct saa7134_dev *dev = container_of(v4l2_dev, struct saa7134_dev, v4l2_dev); 1096 struct saa7134_dev *dev = container_of(v4l2_dev, struct saa7134_dev, v4l2_dev);
1092 struct saa7134_mpeg_ops *mops; 1097 struct saa7134_mpeg_ops *mops;
1093 1098
1099 flush_request_submodules(dev);
1100
1094 /* Release DMA sound modules if present */ 1101 /* Release DMA sound modules if present */
1095 if (saa7134_dmasound_exit && dev->dmasound.priv_data) { 1102 if (saa7134_dmasound_exit && dev->dmasound.priv_data) {
1096 saa7134_dmasound_exit(dev); 1103 saa7134_dmasound_exit(dev);
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index b890aafe7d64..6b8459c7728e 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -553,7 +553,7 @@ static int empress_fini(struct saa7134_dev *dev)
553 553
554 if (NULL == dev->empress_dev) 554 if (NULL == dev->empress_dev)
555 return 0; 555 return 0;
556 flush_scheduled_work(); 556 flush_work_sync(&dev->empress_workqueue);
557 video_unregister_device(dev->empress_dev); 557 video_unregister_device(dev->empress_dev);
558 dev->empress_dev = NULL; 558 dev->empress_dev = NULL;
559 return 0; 559 return 0;