net: ethernet: arc: Don't free Rockchip resources before disconnect from phy
authorRomain Perier <romain.perier@gmail.com>
Wed, 10 Sep 2014 07:51:13 +0000 (07:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2014 20:03:00 +0000 (13:03 -0700)
Free resources before being disconnected from phy and calling core driver is
wrong and should not happen. It avoids a delay of 4-5s caused by the timeout of
phy_disconnect().

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/arc/emac_rockchip.c

index 51d0585e2575fa6c6739237b0b6e22ae7d7f55da..c31c7407b75353c1d2d4f855957b13098a65ab96 100644 (file)
@@ -202,12 +202,13 @@ static int emac_rockchip_remove(struct platform_device *pdev)
        struct rockchip_priv_data *priv = netdev_priv(ndev);
        int err;
 
+       err = arc_emac_remove(ndev);
+
        clk_disable_unprepare(priv->refclk);
 
        if (priv->regulator)
                regulator_disable(priv->regulator);
 
-       err = arc_emac_remove(ndev);
        free_netdev(ndev);
        return err;
 }