Commit 0d9b2ab1 authored by Fabio Estevam's avatar Fabio Estevam Committed by David S. Miller

fec: Use devm_request_irq()

Using devm_request_irq() can make the code smaller and cleaner.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 399db75b
...@@ -2149,14 +2149,10 @@ fec_probe(struct platform_device *pdev) ...@@ -2149,14 +2149,10 @@ fec_probe(struct platform_device *pdev)
ret = irq; ret = irq;
goto failed_irq; goto failed_irq;
} }
ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt,
if (ret) { IRQF_DISABLED, pdev->name, ndev);
while (--i >= 0) { if (ret)
irq = platform_get_irq(pdev, i);
free_irq(irq, ndev);
}
goto failed_irq; goto failed_irq;
}
} }
ret = fec_enet_mii_init(pdev); ret = fec_enet_mii_init(pdev);
...@@ -2180,11 +2176,6 @@ fec_probe(struct platform_device *pdev) ...@@ -2180,11 +2176,6 @@ fec_probe(struct platform_device *pdev)
fec_enet_mii_remove(fep); fec_enet_mii_remove(fep);
failed_mii_init: failed_mii_init:
failed_irq: failed_irq:
for (i = 0; i < FEC_IRQ_NUM; i++) {
irq = platform_get_irq(pdev, i);
if (irq > 0)
free_irq(irq, ndev);
}
failed_init: failed_init:
if (fep->reg_phy) if (fep->reg_phy)
regulator_disable(fep->reg_phy); regulator_disable(fep->reg_phy);
...@@ -2210,17 +2201,11 @@ fec_drv_remove(struct platform_device *pdev) ...@@ -2210,17 +2201,11 @@ fec_drv_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct fec_enet_private *fep = netdev_priv(ndev); struct fec_enet_private *fep = netdev_priv(ndev);
int i;
cancel_delayed_work_sync(&(fep->delay_work.delay_work)); cancel_delayed_work_sync(&(fep->delay_work.delay_work));
unregister_netdev(ndev); unregister_netdev(ndev);
fec_enet_mii_remove(fep); fec_enet_mii_remove(fep);
del_timer_sync(&fep->time_keep); del_timer_sync(&fep->time_keep);
for (i = 0; i < FEC_IRQ_NUM; i++) {
int irq = platform_get_irq(pdev, i);
if (irq > 0)
free_irq(irq, ndev);
}
if (fep->reg_phy) if (fep->reg_phy)
regulator_disable(fep->reg_phy); regulator_disable(fep->reg_phy);
if (fep->clk_ptp) if (fep->clk_ptp)
......
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