Skip to content

Commit

Permalink
fec: Remove irqs first
Browse files Browse the repository at this point in the history
During probe the clocks are enabled prior than the acquiring the interrupts.

In the remove function we need to do the opposite: first remove the interrupts
and then disable the clocks.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Fabio Estevam authored and David S. Miller committed May 28, 2013
1 parent f6a4d60 commit c55284e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,11 @@ fec_drv_remove(struct platform_device *pdev)
unregister_netdev(ndev);
fec_enet_mii_remove(fep);
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)
regulator_disable(fep->reg_phy);
clk_disable_unprepare(fep->clk_ptp);
Expand All @@ -2017,11 +2022,6 @@ fec_drv_remove(struct platform_device *pdev)
clk_disable_unprepare(fep->clk_enet_out);
clk_disable_unprepare(fep->clk_ahb);
clk_disable_unprepare(fep->clk_ipg);
for (i = 0; i < FEC_IRQ_NUM; i++) {
int irq = platform_get_irq(pdev, i);
if (irq > 0)
free_irq(irq, ndev);
}
free_netdev(ndev);

platform_set_drvdata(pdev, NULL);
Expand Down

0 comments on commit c55284e

Please sign in to comment.