dev->maximum_num_channels = le32_to_cpu(bus_info->BusCount);
        }
 
-       if (!dev->sync_mode && dev->sa_firmware &&
-               dev->supplement_adapter_info.virt_device_bus != 0xffff)
-               rcode = aac_setup_safw_adapter(dev, AAC_INIT);
-
        if (!dev->in_reset) {
                char buffer[16];
                tmp = le32_to_cpu(dev->adapter_info.kernelrev);
 
        return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64);
 }
 
+int aac_scan_host(struct aac_dev *dev, int rescan);
 char * get_container_type(unsigned type);
 extern int numacb;
 extern char aac_driver_version[];
 
        return rcode;
 }
 
+int aac_scan_host(struct aac_dev *dev, int rescan)
+{
+       int rcode = 0;
+
+       mutex_lock(&dev->scan_mutex);
+       if (dev->sa_firmware)
+               rcode = aac_update_safw_host_devices(dev, rescan);
+       else
+               scsi_scan_host(dev->scsi_host_ptr);
+       mutex_unlock(&dev->scan_mutex);
+       return rcode;
+}
+
 /**
  *     aac_handle_sa_aif       Handle a message from the firmware
  *     @dev: Which adapter this fib is from
        case SA_AIF_LDEV_CHANGE:
        case SA_AIF_BPCFG_CHANGE:
 
-               mutex_lock(&dev->scan_mutex);
-               aac_update_safw_host_devices(dev, AAC_RESCAN);
-               mutex_unlock(&dev->scan_mutex);
+               aac_scan_host(dev, AAC_RESCAN);
+
                break;
 
        case SA_AIF_BPSTAT_CHANGE:
 
        error = scsi_add_host(shost, &pdev->dev);
        if (error)
                goto out_deinit;
-       scsi_scan_host(shost);
+
+       aac_scan_host(aac, AAC_INIT);
 
        pci_enable_pcie_error_reporting(pdev);
        pci_save_state(pdev);
                if (sdev->sdev_state == SDEV_OFFLINE)
                        sdev->sdev_state = SDEV_RUNNING;
        scsi_unblock_requests(aac->scsi_host_ptr);
-       scsi_scan_host(aac->scsi_host_ptr);
+       aac_scan_host(aac, AAC_RESCAN);
        pci_save_state(pdev);
 
        dev_err(&pdev->dev, "aacraid: PCI error - resume\n");