Commit d9bd00a1 authored by Alexander Gordeev's avatar Alexander Gordeev Committed by David S. Miller

forcedeth: Cleanup MSI-X to MSI to INTx fallback code

Signed-off-by: default avatarAlexander Gordeev <agordeev@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 61c9471e
...@@ -3930,7 +3930,7 @@ static int nv_request_irq(struct net_device *dev, int intr_test) ...@@ -3930,7 +3930,7 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
{ {
struct fe_priv *np = get_nvpriv(dev); struct fe_priv *np = get_nvpriv(dev);
u8 __iomem *base = get_hwbase(dev); u8 __iomem *base = get_hwbase(dev);
int ret = 1; int ret;
int i; int i;
irqreturn_t (*handler)(int foo, void *data); irqreturn_t (*handler)(int foo, void *data);
...@@ -4010,9 +4010,10 @@ static int nv_request_irq(struct net_device *dev, int intr_test) ...@@ -4010,9 +4010,10 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
writel(0, base + NvRegMSIXMap1); writel(0, base + NvRegMSIXMap1);
} }
netdev_info(dev, "MSI-X enabled\n"); netdev_info(dev, "MSI-X enabled\n");
return 0;
} }
} }
if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) { if (np->msi_flags & NV_MSI_CAPABLE) {
ret = pci_enable_msi(np->pci_dev); ret = pci_enable_msi(np->pci_dev);
if (ret == 0) { if (ret == 0) {
np->msi_flags |= NV_MSI_ENABLED; np->msi_flags |= NV_MSI_ENABLED;
...@@ -4031,13 +4032,12 @@ static int nv_request_irq(struct net_device *dev, int intr_test) ...@@ -4031,13 +4032,12 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
/* enable msi vector 0 */ /* enable msi vector 0 */
writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask); writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
netdev_info(dev, "MSI enabled\n"); netdev_info(dev, "MSI enabled\n");
return 0;
} }
} }
if (ret != 0) {
if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, dev->name, dev) != 0)
goto out_err;
} if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, dev->name, dev) != 0)
goto out_err;
return 0; return 0;
out_free_tx: out_free_tx:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment