aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Derrick <jonathan.derrick@intel.com>2016-08-29 13:19:02 -0400
committerBjorn Helgaas <bhelgaas@google.com>2016-09-19 14:14:05 -0400
commit75de9b4cd3119eaddce6616776f62a5b30fb0fae (patch)
tree65800a15cde5f26e78db69e013d54e59df07fd08
parentc68db51589052ef9adee4dd699462681737849a2 (diff)
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.c15
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 {
76 char __iomem *cfgbar; 76 char __iomem *cfgbar;
77 77
78 int msix_count; 78 int msix_count;
79 struct msix_entry *msix_entries;
80 struct vmd_irq_list *irqs; 79 struct vmd_irq_list *irqs;
81 80
82 struct pci_sysdata sysdata; 81 struct pci_sysdata sysdata;
@@ -671,16 +670,8 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
671 if (vmd->msix_count < 0) 670 if (vmd->msix_count < 0)
672 return -ENODEV; 671 return -ENODEV;
673 672
674 vmd->msix_entries = devm_kcalloc(&dev->dev, vmd->msix_count, 673 vmd->msix_count = pci_alloc_irq_vectors(dev, 1, vmd->msix_count,
675 sizeof(*vmd->msix_entries), 674 PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
676 GFP_KERNEL);
677 if (!vmd->msix_entries)
678 return -ENOMEM;
679 for (i = 0; i < vmd->msix_count; i++)
680 vmd->msix_entries[i].entry = i;
681
682 vmd->msix_count = pci_enable_msix_range(vmd->dev, vmd->msix_entries, 1,
683 vmd->msix_count);
684 if (vmd->msix_count < 0) 675 if (vmd->msix_count < 0)
685 return vmd->msix_count; 676 return vmd->msix_count;
686 677
@@ -691,7 +682,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
691 682
692 for (i = 0; i < vmd->msix_count; i++) { 683 for (i = 0; i < vmd->msix_count; i++) {
693 INIT_LIST_HEAD(&vmd->irqs[i].irq_list); 684 INIT_LIST_HEAD(&vmd->irqs[i].irq_list);
694 vmd->irqs[i].vmd_vector = vmd->msix_entries[i].vector; 685 vmd->irqs[i].vmd_vector = pci_irq_vector(dev, i);
695 vmd->irqs[i].index = i; 686 vmd->irqs[i].index = i;
696 687
697 err = devm_request_irq(&dev->dev, vmd->irqs[i].vmd_vector, 688 err = devm_request_irq(&dev->dev, vmd->irqs[i].vmd_vector,