]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: Use PCI device flag helper functions
authorEthan Zhao <ethan.zhao@oracle.com>
Tue, 9 Sep 2014 02:21:26 +0000 (10:21 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 16 Sep 2014 22:18:40 +0000 (16:18 -0600)
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>
virt/kvm/assigned-dev.c
virt/kvm/iommu.c

index 5819a2708d7edd5823d9e5885a6b7c3796b387ad..e05000e200d22bf7e7edf1ba6a3d8dbc1d1c9a6b 100644 (file)
@@ -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);
index 714b949323120aee855dd7e57db549cac31e8183..e723bb91aa346a3bbc0805e064a3823838d2a7c1 100644 (file)
@@ -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");