aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18
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/cx18
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/cx18')
-rw-r--r--drivers/media/video/cx18/cx18-driver.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index df60f27337cf..f6fdcfb1084b 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -266,8 +266,14 @@ static void request_modules(struct cx18 *dev)
266 INIT_WORK(&dev->request_module_wk, request_module_async); 266 INIT_WORK(&dev->request_module_wk, request_module_async);
267 schedule_work(&dev->request_module_wk); 267 schedule_work(&dev->request_module_wk);
268} 268}
269
270static void flush_request_modules(struct cx18 *dev)
271{
272 flush_work_sync(&dev->request_module_wk);
273}
269#else 274#else
270#define request_modules(dev) 275#define request_modules(dev)
276#define flush_request_modules(dev)
271#endif /* CONFIG_MODULES */ 277#endif /* CONFIG_MODULES */
272 278
273/* Generic utility functions */ 279/* Generic utility functions */
@@ -1226,6 +1232,8 @@ static void cx18_remove(struct pci_dev *pci_dev)
1226 1232
1227 CX18_DEBUG_INFO("Removing Card\n"); 1233 CX18_DEBUG_INFO("Removing Card\n");
1228 1234
1235 flush_request_modules(cx);
1236
1229 /* Stop all captures */ 1237 /* Stop all captures */
1230 CX18_DEBUG_INFO("Stopping all streams\n"); 1238 CX18_DEBUG_INFO("Stopping all streams\n");
1231 if (atomic_read(&cx->tot_capturing) > 0) 1239 if (atomic_read(&cx->tot_capturing) > 0)