diff options
| author | Ethan Zhao <ethan.zhao@oracle.com> | 2014-09-08 22:21:26 -0400 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-09-16 18:18:40 -0400 |
| commit | ad0d217ca645477ba30c2f3cf1a5bbb7ef18b1fd (patch) | |
| tree | e7ae854942fa8df8538176afd6708963d3100d60 /virt | |
| parent | ce0529843a505d09f5809a7db6288d2f038f64c4 (diff) | |
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>
Diffstat (limited to 'virt')
| -rw-r--r-- | virt/kvm/assigned-dev.c | 2 | ||||
| -rw-r--r-- | virt/kvm/iommu.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index 5819a2708d7e..e05000e200d2 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c | |||
| @@ -302,7 +302,7 @@ static void kvm_free_assigned_device(struct kvm *kvm, | |||
| 302 | else | 302 | else |
| 303 | pci_restore_state(assigned_dev->dev); | 303 | pci_restore_state(assigned_dev->dev); |
| 304 | 304 | ||
| 305 | assigned_dev->dev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; | 305 | pci_clear_dev_assigned(assigned_dev->dev); |
| 306 | 306 | ||
| 307 | pci_release_regions(assigned_dev->dev); | 307 | pci_release_regions(assigned_dev->dev); |
| 308 | pci_disable_device(assigned_dev->dev); | 308 | pci_disable_device(assigned_dev->dev); |
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index 714b94932312..e723bb91aa34 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c | |||
| @@ -203,7 +203,7 @@ int kvm_assign_device(struct kvm *kvm, | |||
| 203 | goto out_unmap; | 203 | goto out_unmap; |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; | 206 | pci_set_dev_assigned(pdev); |
| 207 | 207 | ||
| 208 | dev_info(&pdev->dev, "kvm assign device\n"); | 208 | dev_info(&pdev->dev, "kvm assign device\n"); |
| 209 | 209 | ||
| @@ -229,7 +229,7 @@ int kvm_deassign_device(struct kvm *kvm, | |||
| 229 | 229 | ||
| 230 | iommu_detach_device(domain, &pdev->dev); | 230 | iommu_detach_device(domain, &pdev->dev); |
| 231 | 231 | ||
| 232 | pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; | 232 | pci_clear_dev_assigned(pdev); |
| 233 | 233 | ||
| 234 | dev_info(&pdev->dev, "kvm deassign device\n"); | 234 | dev_info(&pdev->dev, "kvm deassign device\n"); |
| 235 | 235 | ||
