Merge branch 'fix/hda' into for-linus
[firefly-linux-kernel-4.4.55.git] / drivers / scsi / scsi_wait_scan.c
index 8a636103083d40c66d1d0326a3a9421c9c6bed58..74708fcaf82fe900c3a77689ccad11c91b48b173 100644 (file)
  */
 
 #include <linux/module.h>
-#include "scsi_priv.h"
+#include <linux/device.h>
+#include <scsi/scsi_scan.h>
 
 static int __init wait_scan_init(void)
 {
+       /*
+        * First we need to wait for device probing to finish;
+        * the drivers we just loaded might just still be probing
+        * and might not yet have reached the scsi async scanning
+        */
+       wait_for_device_probe();
+       /*
+        * and then we wait for the actual asynchronous scsi scan
+        * to finish.
+        */
        scsi_complete_async_scans();
        return 0;
 }