diff options
author | Christoph Hellwig <hch@lst.de> | 2017-02-09 10:10:58 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-02-19 09:18:45 -0500 |
commit | f50cccdd03ed4b22960308a5d2499519df13ee9b (patch) | |
tree | 412632eed2b1f323bb983e26408e25e46d42952e | |
parent | 1bb0d7b781b1ca647f1ae69665c0ad1de09a1174 (diff) |
IB/mthca: switch to pci_alloc_irq_vectors
Trivial switch to the new API for this driver.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_main.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index ded76c101dde..c309e5c96383 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c | |||
@@ -851,20 +851,18 @@ err_uar_table_free: | |||
851 | 851 | ||
852 | static int mthca_enable_msi_x(struct mthca_dev *mdev) | 852 | static int mthca_enable_msi_x(struct mthca_dev *mdev) |
853 | { | 853 | { |
854 | struct msix_entry entries[3]; | ||
855 | int err; | 854 | int err; |
856 | 855 | ||
857 | entries[0].entry = 0; | 856 | err = pci_alloc_irq_vectors(mdev->pdev, 3, 3, PCI_IRQ_MSIX); |
858 | entries[1].entry = 1; | 857 | if (err < 0) |
859 | entries[2].entry = 2; | ||
860 | |||
861 | err = pci_enable_msix_exact(mdev->pdev, entries, ARRAY_SIZE(entries)); | ||
862 | if (err) | ||
863 | return err; | 858 | return err; |
864 | 859 | ||
865 | mdev->eq_table.eq[MTHCA_EQ_COMP ].msi_x_vector = entries[0].vector; | 860 | mdev->eq_table.eq[MTHCA_EQ_COMP ].msi_x_vector = |
866 | mdev->eq_table.eq[MTHCA_EQ_ASYNC].msi_x_vector = entries[1].vector; | 861 | pci_irq_vector(mdev->pdev, 0); |
867 | mdev->eq_table.eq[MTHCA_EQ_CMD ].msi_x_vector = entries[2].vector; | 862 | mdev->eq_table.eq[MTHCA_EQ_ASYNC].msi_x_vector = |
863 | pci_irq_vector(mdev->pdev, 1); | ||
864 | mdev->eq_table.eq[MTHCA_EQ_CMD ].msi_x_vector = | ||
865 | pci_irq_vector(mdev->pdev, 2); | ||
868 | 866 | ||
869 | return 0; | 867 | return 0; |
870 | } | 868 | } |
@@ -1018,7 +1016,7 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type) | |||
1018 | err = mthca_setup_hca(mdev); | 1016 | err = mthca_setup_hca(mdev); |
1019 | if (err == -EBUSY && (mdev->mthca_flags & MTHCA_FLAG_MSI_X)) { | 1017 | if (err == -EBUSY && (mdev->mthca_flags & MTHCA_FLAG_MSI_X)) { |
1020 | if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) | 1018 | if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) |
1021 | pci_disable_msix(pdev); | 1019 | pci_free_irq_vectors(pdev); |
1022 | mdev->mthca_flags &= ~MTHCA_FLAG_MSI_X; | 1020 | mdev->mthca_flags &= ~MTHCA_FLAG_MSI_X; |
1023 | 1021 | ||
1024 | err = mthca_setup_hca(mdev); | 1022 | err = mthca_setup_hca(mdev); |
@@ -1062,7 +1060,7 @@ err_cleanup: | |||
1062 | 1060 | ||
1063 | err_close: | 1061 | err_close: |
1064 | if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) | 1062 | if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) |
1065 | pci_disable_msix(pdev); | 1063 | pci_free_irq_vectors(pdev); |
1066 | 1064 | ||
1067 | mthca_close_hca(mdev); | 1065 | mthca_close_hca(mdev); |
1068 | 1066 | ||
@@ -1113,7 +1111,7 @@ static void __mthca_remove_one(struct pci_dev *pdev) | |||
1113 | mthca_cmd_cleanup(mdev); | 1111 | mthca_cmd_cleanup(mdev); |
1114 | 1112 | ||
1115 | if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) | 1113 | if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) |
1116 | pci_disable_msix(pdev); | 1114 | pci_free_irq_vectors(pdev); |
1117 | 1115 | ||
1118 | ib_dealloc_device(&mdev->ib_dev); | 1116 | ib_dealloc_device(&mdev->ib_dev); |
1119 | pci_release_regions(pdev); | 1117 | pci_release_regions(pdev); |