diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-24 15:14:20 (GMT) |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-24 15:14:20 (GMT) |
commit | 707bcf326bd50c875d82bd2e7c31dcfb92b7e813 (patch) | |
tree | 6359ba94e571ca15ef6fa0ff44f5872c8210e157 /drivers/media/video/em28xx | |
parent | 883624a08cb4144343e7362d9fff0e2c69613ebf (diff) | |
download | linux-fsl-qoriq-707bcf326bd50c875d82bd2e7c31dcfb92b7e813.tar.xz |
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/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 5485923..d60538b 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c @@ -2632,8 +2632,14 @@ static void request_modules(struct em28xx *dev) INIT_WORK(&dev->request_module_wk, request_module_async); schedule_work(&dev->request_module_wk); } + +static void flush_request_modules(struct em28xx *dev) +{ + flush_work_sync(&dev->request_module_wk); +} #else #define request_modules(dev) +#define flush_request_modules(dev) #endif /* CONFIG_MODULES */ /* @@ -3060,6 +3066,8 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) em28xx_info("disconnecting %s\n", dev->vdev->name); + flush_request_modules(dev); + /* wait until all current v4l2 io is finished then deallocate resources */ mutex_lock(&dev->lock); |