Browse Source

KVM: Use PCI device flag helper functions

Use PCI device flag helper functions when assigning or releasing device.
No functional change.

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Ethan Zhao 11 years ago
parent
commit
ad0d217ca6
2 changed files with 3 additions and 3 deletions
  1. 1 1
      virt/kvm/assigned-dev.c
  2. 2 2
      virt/kvm/iommu.c

+ 1 - 1
virt/kvm/assigned-dev.c

@@ -302,7 +302,7 @@ static void kvm_free_assigned_device(struct kvm *kvm,
 	else
 	else
 		pci_restore_state(assigned_dev->dev);
 		pci_restore_state(assigned_dev->dev);
 
 
-	assigned_dev->dev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
+	pci_clear_dev_assigned(assigned_dev->dev);
 
 
 	pci_release_regions(assigned_dev->dev);
 	pci_release_regions(assigned_dev->dev);
 	pci_disable_device(assigned_dev->dev);
 	pci_disable_device(assigned_dev->dev);

+ 2 - 2
virt/kvm/iommu.c

@@ -203,7 +203,7 @@ int kvm_assign_device(struct kvm *kvm,
 			goto out_unmap;
 			goto out_unmap;
 	}
 	}
 
 
-	pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
+	pci_set_dev_assigned(pdev);
 
 
 	dev_info(&pdev->dev, "kvm assign device\n");
 	dev_info(&pdev->dev, "kvm assign device\n");
 
 
@@ -229,7 +229,7 @@ int kvm_deassign_device(struct kvm *kvm,
 
 
 	iommu_detach_device(domain, &pdev->dev);
 	iommu_detach_device(domain, &pdev->dev);
 
 
-	pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED;
+	pci_clear_dev_assigned(pdev);
 
 
 	dev_info(&pdev->dev, "kvm deassign device\n");
 	dev_info(&pdev->dev, "kvm deassign device\n");