Commit 86cc070e authored by Nicolas Ferre's avatar Nicolas Ferre Committed by David S. Miller

net/at91_ether: use gpio_to_irq for phy IRQ line

Use the gpio_to_irq() function to retrieve the phy IRQ line
from the GPIO pin specification.
This fix is needed now that we have moved to irqdomains on AT91.
Reported-by: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Cc: Andrew Victor <avictor.za@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5f0f83c
...@@ -263,7 +263,7 @@ static void enable_phyirq(struct net_device *dev) ...@@ -263,7 +263,7 @@ static void enable_phyirq(struct net_device *dev)
return; return;
} }
irq_number = lp->board_data.phy_irq_pin; irq_number = gpio_to_irq(lp->board_data.phy_irq_pin);
status = request_irq(irq_number, at91ether_phy_interrupt, 0, dev->name, dev); status = request_irq(irq_number, at91ether_phy_interrupt, 0, dev->name, dev);
if (status) { if (status) {
printk(KERN_ERR "at91_ether: PHY IRQ %d request failed - status %d!\n", irq_number, status); printk(KERN_ERR "at91_ether: PHY IRQ %d request failed - status %d!\n", irq_number, status);
...@@ -363,7 +363,7 @@ static void disable_phyirq(struct net_device *dev) ...@@ -363,7 +363,7 @@ static void disable_phyirq(struct net_device *dev)
disable_mdi(lp); disable_mdi(lp);
spin_unlock_irq(&lp->lock); spin_unlock_irq(&lp->lock);
irq_number = lp->board_data.phy_irq_pin; irq_number = gpio_to_irq(lp->board_data.phy_irq_pin);
free_irq(irq_number, dev); /* Free interrupt handler */ free_irq(irq_number, dev); /* Free interrupt handler */
} }
...@@ -1234,7 +1234,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg) ...@@ -1234,7 +1234,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
if (netif_running(net_dev)) { if (netif_running(net_dev)) {
if (gpio_is_valid(lp->board_data.phy_irq_pin)) { if (gpio_is_valid(lp->board_data.phy_irq_pin)) {
int phy_irq = lp->board_data.phy_irq_pin; int phy_irq = gpio_to_irq(lp->board_data.phy_irq_pin);
disable_irq(phy_irq); disable_irq(phy_irq);
} }
...@@ -1258,7 +1258,7 @@ static int at91ether_resume(struct platform_device *pdev) ...@@ -1258,7 +1258,7 @@ static int at91ether_resume(struct platform_device *pdev)
netif_start_queue(net_dev); netif_start_queue(net_dev);
if (gpio_is_valid(lp->board_data.phy_irq_pin)) { if (gpio_is_valid(lp->board_data.phy_irq_pin)) {
int phy_irq = lp->board_data.phy_irq_pin; int phy_irq = gpio_to_irq(lp->board_data.phy_irq_pin);
enable_irq(phy_irq); enable_irq(phy_irq);
} }
} }
......
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