net/fec: postpone unsetting driver data until the hardware is stopped
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 25 Jan 2011 17:03:37 +0000 (18:03 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 15 Feb 2011 08:26:31 +0000 (09:26 +0100)
Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/net/fec.c

index 0c984d6b25f62d8ffe7edb47967531c044e1a3cf..c3229713b1e234495fded0775a7a0bbcd3181e98 100644 (file)
@@ -1465,8 +1465,6 @@ fec_drv_remove(struct platform_device *pdev)
        struct fec_enet_private *fep = netdev_priv(ndev);
        struct resource *r;
 
-       platform_set_drvdata(pdev, NULL);
-
        fec_stop(ndev);
        fec_enet_mii_remove(fep);
        clk_disable(fep->clk);
@@ -1479,6 +1477,8 @@ fec_drv_remove(struct platform_device *pdev)
        BUG_ON(!r);
        release_mem_region(r->start, resource_size(r));
 
+       platform_set_drvdata(pdev, NULL);
+
        return 0;
 }