aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-12-24 10:14:20 -0500
committerTejun Heo <tj@kernel.org>2010-12-24 10:14:20 -0500
commit707bcf326bd50c875d82bd2e7c31dcfb92b7e813 (patch)
tree6359ba94e571ca15ef6fa0ff44f5872c8210e157 /drivers/media/video/bt8xx/bttv-driver.c
parent883624a08cb4144343e7362d9fff0e2c69613ebf (diff)
media/video: explicitly flush request_module work
Video drivers request submodules using a work during probe and calls flush_scheduled_work() on exit to make sure the work is complete before being unloaded. This patch makes these drivers flush the work directly instead of using flush_scheduled_work(). While at it, relocate request_submodules() call in saa7134_initdev() right right before successful return as in other drivers to avoid failing after the work is scheduled and returning failure without the work still active. This is in preparation for the deprecation of flush_scheduled_work(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index a529619e51f..53285aa6e72 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
@@ -4573,6 +4579,9 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev)
4573 if (bttv_verbose) 4579 if (bttv_verbose)
4574 printk("bttv%d: unloading\n",btv->c.nr); 4580 printk("bttv%d: unloading\n",btv->c.nr);
4575 4581
4582 if (bttv_tvcards[btv->c.type].has_dvb)
4583 flush_request_modules(btv);
4584
4576 /* shutdown everything (DMA+IRQs) */ 4585 /* shutdown everything (DMA+IRQs) */
4577 btand(~15, BT848_GPIO_DMA_CTL); 4586 btand(~15, BT848_GPIO_DMA_CTL);
4578 btwrite(0, BT848_INT_MASK); 4587 btwrite(0, BT848_INT_MASK);