diff options
author | Jon Derrick <jonathan.derrick@intel.com> | 2016-08-29 11:19:02 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-09-19 13:14:05 -0500 |
commit | 75de9b4cd3119eaddce6616776f62a5b30fb0fae (patch) | |
tree | 65800a15cde5f26e78db69e013d54e59df07fd08 | |
parent | c68db51589052ef9adee4dd699462681737849a2 (diff) | |
download | linux-75de9b4cd3119eaddce6616776f62a5b30fb0fae.tar.bz2 |
x86/PCI: VMD: Convert to use pci_alloc_irq_vectors() API
Convert to use the pci_alloc_irq_vectors() API.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
-rw-r--r-- | arch/x86/pci/vmd.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/x86/pci/vmd.c b/arch/x86/pci/vmd.c index 7a8538da6289..f576dcba2175 100644 --- a/arch/x86/pci/vmd.c +++ b/arch/x86/pci/vmd.c @@ -76,7 +76,6 @@ struct vmd_dev { char __iomem *cfgbar; int msix_count; - struct msix_entry *msix_entries; struct vmd_irq_list *irqs; struct pci_sysdata sysdata; @@ -671,16 +670,8 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) if (vmd->msix_count < 0) return -ENODEV; - vmd->msix_entries = devm_kcalloc(&dev->dev, vmd->msix_count, - sizeof(*vmd->msix_entries), - GFP_KERNEL); - if (!vmd->msix_entries) - return -ENOMEM; - for (i = 0; i < vmd->msix_count; i++) - vmd->msix_entries[i].entry = i; - - vmd->msix_count = pci_enable_msix_range(vmd->dev, vmd->msix_entries, 1, - vmd->msix_count); + vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count, + PCI_IRQ_MSIX | PCI_IRQ_AFFINITY); if (vmd->msix_count < 0) return vmd->msix_count; @@ -691,7 +682,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) for (i = 0; i < vmd->msix_count; i++) { INIT_LIST_HEAD(&vmd->irqs[i].irq_list); - vmd->irqs[i].vmd_vector = vmd->msix_entries[i].vector; + vmd->irqs[i].vmd_vector = pci_irq_vector(dev, i); vmd->irqs[i].index = i; err = devm_request_irq(&dev->dev, vmd->irqs[i].vmd_vector, |