From: Ethan Zhao Date: Tue, 9 Sep 2014 02:21:26 +0000 (+0800) Subject: KVM: Use PCI device flag helper functions X-Git-Tag: v3.18-rc1~110^2~13^4~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ad0d217ca645477ba30c2f3cf1a5bbb7ef18b1fd;p=karo-tx-linux.git 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 Signed-off-by: Bjorn Helgaas Acked-by: Paolo Bonzini --- 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, 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); 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, goto out_unmap; } - pdev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; + pci_set_dev_assigned(pdev); 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); - pdev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; + pci_clear_dev_assigned(pdev); dev_info(&pdev->dev, "kvm deassign device\n");