aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 96fa2da30763..970a3f415244 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1047,6 +1047,17 @@ static int stmmac_open(struct net_device *dev)
1047 goto open_error; 1047 goto open_error;
1048 } 1048 }
1049 1049
1050 /* Request the Wake IRQ in case of another line is used for WoL */
1051 if (priv->wol_irq != dev->irq) {
1052 ret = request_irq(priv->wol_irq, stmmac_interrupt,
1053 IRQF_SHARED, dev->name, dev);
1054 if (unlikely(ret < 0)) {
1055 pr_err("%s: ERROR: allocating the ext WoL IRQ %d "
1056 "(error: %d)\n", __func__, priv->wol_irq, ret);
1057 goto open_error_wolirq;
1058 }
1059 }
1060
1050 /* Enable the MAC Rx/Tx */ 1061 /* Enable the MAC Rx/Tx */
1051 stmmac_set_mac(priv->ioaddr, true); 1062 stmmac_set_mac(priv->ioaddr, true);
1052 1063
@@ -1087,6 +1098,9 @@ static int stmmac_open(struct net_device *dev)
1087 1098
1088 return 0; 1099 return 0;
1089 1100
1101open_error_wolirq:
1102 free_irq(dev->irq, dev);
1103
1090open_error: 1104open_error:
1091#ifdef CONFIG_STMMAC_TIMER 1105#ifdef CONFIG_STMMAC_TIMER
1092 kfree(priv->tm); 1106 kfree(priv->tm);
@@ -1127,6 +1141,8 @@ static int stmmac_release(struct net_device *dev)
1127 1141
1128 /* Free the IRQ lines */ 1142 /* Free the IRQ lines */
1129 free_irq(dev->irq, dev); 1143 free_irq(dev->irq, dev);
1144 if (priv->wol_irq != dev->irq)
1145 free_irq(priv->wol_irq, dev);
1130 1146
1131 /* Stop TX/RX DMA and clear the descriptors */ 1147 /* Stop TX/RX DMA and clear the descriptors */
1132 priv->hw->dma->stop_tx(priv->ioaddr); 1148 priv->hw->dma->stop_tx(priv->ioaddr);