Skip to content

Commit

Permalink
KVM: Use PCI device flag helper functions
Browse files Browse the repository at this point in the history
Use PCI device flag helper functions when assigning or releasing device.
No functional change.

Signed-off-by: Ethan Zhao <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Ethan Zhao authored and bjorn-helgaas committed Sep 16, 2014
1 parent ce05298 commit ad0d217
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion virt/kvm/assigned-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static void kvm_free_assigned_device(struct kvm *kvm,
else
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_disable_device(assigned_dev->dev);
Expand Down
4 changes: 2 additions & 2 deletions virt/kvm/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int kvm_assign_device(struct kvm *kvm,
goto out_unmap;
}

pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
pci_set_dev_assigned(pdev);

dev_info(&pdev->dev, "kvm assign device\n");

Expand All @@ -229,7 +229,7 @@ int kvm_deassign_device(struct kvm *kvm,

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");

Expand Down

0 comments on commit ad0d217

Please sign in to comment.