vxge: Use pci_enable_msix_range() instead of pci_enable_msix()
authorAlexander Gordeev <agordeev@redhat.com>
Tue, 18 Feb 2014 10:11:51 +0000 (11:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Feb 2014 20:33:32 +0000 (15:33 -0500)
As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range() and pci_enable_msix_range()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/neterion/vxge/vxge-main.c

index e46e8698e6309a67945121ad86cb0ee4a61ff2b6..c83cedd26dec637eaec9b4c505730adef028658c 100644 (file)
@@ -2349,12 +2349,18 @@ start:
        vdev->vxge_entries[j].entry = VXGE_ALARM_MSIX_ID;
        vdev->vxge_entries[j].in_use = 0;
 
-       ret = pci_enable_msix(vdev->pdev, vdev->entries, vdev->intr_cnt);
-       if (ret > 0) {
+       ret = pci_enable_msix_range(vdev->pdev,
+                                   vdev->entries, 3, vdev->intr_cnt);
+       if (ret < 0) {
+               ret = -ENODEV;
+               goto enable_msix_failed;
+       } else if (ret < vdev->intr_cnt) {
+               pci_disable_msix(vdev->pdev);
+
                vxge_debug_init(VXGE_ERR,
                        "%s: MSI-X enable failed for %d vectors, ret: %d",
                        VXGE_DRIVER_NAME, vdev->intr_cnt, ret);
-               if ((max_config_vpath != VXGE_USE_DEFAULT) || (ret < 3)) {
+               if (max_config_vpath != VXGE_USE_DEFAULT) {
                        ret = -ENODEV;
                        goto enable_msix_failed;
                }
@@ -2368,9 +2374,6 @@ start:
                vxge_close_vpaths(vdev, temp);
                vdev->no_of_vpath = temp;
                goto start;
-       } else if (ret < 0) {
-               ret = -ENODEV;
-               goto enable_msix_failed;
        }
        return 0;