wil6210: Use pci_enable_msi_range() instead of pci_enable_msi_block()
authorAlexander Gordeev <agordeev@redhat.com>
Tue, 18 Feb 2014 10:12:04 +0000 (11:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Feb 2014 20:33:34 +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: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: wil6210@qca.qualcomm.com
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/ath/wil6210/pcie_bus.c

index eeceab39cda22aee81e2fcbb86fc0c9520766a5f..e1c8cc4a4b92261bf37a3410ebd9cc4175082f9a 100644 (file)
@@ -41,30 +41,28 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil)
        switch (use_msi) {
        case 3:
        case 1:
+               wil_dbg_misc(wil, "Setup %d MSI interrupts\n", use_msi);
+               break;
        case 0:
+               wil_dbg_misc(wil, "MSI interrupts disabled, use INTx\n");
                break;
        default:
-               wil_err(wil, "Invalid use_msi=%d, default to 1\n",
-                       use_msi);
+               wil_err(wil, "Invalid use_msi=%d, default to 1\n", use_msi);
                use_msi = 1;
        }
-       wil->n_msi = use_msi;
-       if (wil->n_msi) {
-               wil_dbg_misc(wil, "Setup %d MSI interrupts\n", use_msi);
-               rc = pci_enable_msi_block(pdev, wil->n_msi);
-               if (rc && (wil->n_msi == 3)) {
-                       wil_err(wil, "3 MSI mode failed, try 1 MSI\n");
-                       wil->n_msi = 1;
-                       rc = pci_enable_msi_block(pdev, wil->n_msi);
-               }
-               if (rc) {
-                       wil_err(wil, "pci_enable_msi failed, use INTx\n");
-                       wil->n_msi = 0;
-               }
-       } else {
-               wil_dbg_misc(wil, "MSI interrupts disabled, use INTx\n");
+
+       if (use_msi == 3 && pci_enable_msi_range(pdev, 3, 3) < 0) {
+               wil_err(wil, "3 MSI mode failed, try 1 MSI\n");
+               use_msi = 1;
+       }
+
+       if (use_msi == 1 && pci_enable_msi(pdev)) {
+               wil_err(wil, "pci_enable_msi failed, use INTx\n");
+               use_msi = 0;
        }
 
+       wil->n_msi = use_msi;
+
        rc = wil6210_init_irq(wil, pdev->irq);
        if (rc)
                goto stop_master;