]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fec: Remove irqs first
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 27 May 2013 03:48:32 +0000 (03:48 +0000)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:19 +0000 (09:54 +0800)
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>
drivers/net/ethernet/freescale/fec_main.c

index 2921bf9b3501f984a5260dc077ddbcf003d7589e..ec57f3a29a4b27e85eedd963d9b97bc5927bad67 100644 (file)
@@ -2035,6 +2035,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);
@@ -2043,11 +2048,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);