diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-24 16:14:20 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-24 16:14:20 +0100 |
commit | 707bcf326bd50c875d82bd2e7c31dcfb92b7e813 (patch) | |
tree | 6359ba94e571ca15ef6fa0ff44f5872c8210e157 /drivers/media/video/bt8xx | |
parent | 883624a08cb4144343e7362d9fff0e2c69613ebf (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')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 9 |
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 a529619e51f6..53285aa6e72c 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) INIT_WORK(&dev->request_module_wk, request_module_async); schedule_work(&dev->request_module_wk); } + +static void flush_request_modules(struct bttv *dev) +{ + flush_work_sync(&dev->request_module_wk); +} #else #define request_modules(dev) +#define flush_request_modules(dev) #endif /* CONFIG_MODULES */ @@ -4573,6 +4579,9 @@ static void __devexit bttv_remove(struct pci_dev *pci_dev) if (bttv_verbose) printk("bttv%d: unloading\n",btv->c.nr); + if (bttv_tvcards[btv->c.type].has_dvb) + flush_request_modules(btv); + /* shutdown everything (DMA+IRQs) */ btand(~15, BT848_GPIO_DMA_CTL); btwrite(0, BT848_INT_MASK); |