static void hclge_disable_sriov(struct hclge_dev *hdev)
{
-#ifdef CONFIG_PCI_IOV
- /* If our VFs are assigned we cannot shut down SR-IOV
- * without causing issues, so just leave the hardware
- * available but disabled
- */
- if (pci_vfs_assigned(hdev->pdev)) {
- dev_warn(&hdev->pdev->dev,
- "disabling driver while VFs are assigned\n");
- return;
- }
+ /* If our VFs are assigned we cannot shut down SR-IOV
+ * without causing issues, so just leave the hardware
+ * available but disabled
+ */
+ if (pci_vfs_assigned(hdev->pdev)) {
+ dev_warn(&hdev->pdev->dev,
+ "disabling driver while VFs are assigned\n");
+ return;
+ }
- pci_disable_sriov(hdev->pdev);
-#endif
+ pci_disable_sriov(hdev->pdev);
}
struct hclge_vport *hclge_get_vport(struct hnae3_handle *handle)
set_bit(HCLGE_STATE_DOWN, &hdev->state);
-#ifdef CONFIG_PCI_IOV
- hclge_disable_sriov(hdev);
-#endif
+ if (IS_ENABLED(CONFIG_PCI_IOV))
+ hclge_disable_sriov(hdev);
if (hdev->service_timer.data)
del_timer_sync(&hdev->service_timer);