media/video: explicitly flush request_module work
[deliverable/linux.git] / drivers / media / video / em28xx / em28xx-cards.c
index 54859233f31188e3b1e4d6f7aed45b37113ae27a..d60538bb22b34426b72a295b1f7c8b237a3291eb 100644 (file)
@@ -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);
This page took 0.025605 seconds and 5 git commands to generate.