aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
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/cx88
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/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c8
1 files changed, 8 insertions, 0 deletions
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;