Commit 71527ef4 authored by David Brownell's avatar David Brownell Committed by Jeff Garzik

at91_ether: request/free GPIO for PHY interrupt

When the at91_ether driver is using a GPIO for its PHY interrupt,
be sure to request (and later, if needed, free) that GPIO.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent e83603fd
...@@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add ...@@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
init_timer(&lp->check_timer); init_timer(&lp->check_timer);
lp->check_timer.data = (unsigned long)dev; lp->check_timer.data = (unsigned long)dev;
lp->check_timer.function = at91ether_check_link; lp->check_timer.function = at91ether_check_link;
} } else if (lp->board_data.phy_irq_pin >= 32)
gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy");
/* Display ethernet banner */ /* Display ethernet banner */
printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n",
...@@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(struct platform_device *pdev) ...@@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(struct platform_device *pdev)
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct at91_private *lp = netdev_priv(dev); struct at91_private *lp = netdev_priv(dev);
if (lp->board_data.phy_irq_pin >= 32)
gpio_free(lp->board_data.phy_irq_pin);
unregister_netdev(dev); unregister_netdev(dev);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys);
......
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