aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx231xx
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/cx231xx
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/cx231xx')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-cards.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 56c2d8195ac6..05b65057b8a7 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -762,8 +762,14 @@ static void request_modules(struct cx231xx *dev)
762 INIT_WORK(&dev->request_module_wk, request_module_async); 762 INIT_WORK(&dev->request_module_wk, request_module_async);
763 schedule_work(&dev->request_module_wk); 763 schedule_work(&dev->request_module_wk);
764} 764}
765
766static void flush_request_modules(struct cx231xx *dev)
767{
768 flush_work_sync(&dev->request_module_wk);
769}
765#else 770#else
766#define request_modules(dev) 771#define request_modules(dev)
772#define flush_request_modules(dev)
767#endif /* CONFIG_MODULES */ 773#endif /* CONFIG_MODULES */
768 774
769/* 775/*
@@ -1096,6 +1102,8 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
1096 if (!dev->udev) 1102 if (!dev->udev)
1097 return; 1103 return;
1098 1104
1105 flush_request_modules(dev);
1106
1099 /* delete v4l2 device */ 1107 /* delete v4l2 device */
1100 v4l2_device_unregister(&dev->v4l2_dev); 1108 v4l2_device_unregister(&dev->v4l2_dev);
1101 1109