summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/arc
diff options
context:
space:
mode:
authorXing Zheng <zhengxing@rock-chips.com>2016-01-08 04:35:00 +0300
committerDavid S. Miller <davem@davemloft.net>2016-01-11 06:21:31 +0300
commitc9bca2fe3ca6d6dac2a27eb8619955648369efed (patch)
treeac3bda6a929df87dbfcbade5e7927810758489dd /drivers/net/ethernet/arc
parent0652cb5b8b228db53b686c735c64bdb9071979de (diff)
downloadlinux-c9bca2fe3ca6d6dac2a27eb8619955648369efed.tar.xz
net: ethernet: arc: Probe emac after set RMII clock
After enter arc_emac_probe, emac will get_phy_id, phy_poll_reset and other connecting PHY via mdiobus_read, so we need to set correct ref clock rate for emac before probe emac. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/arc')
-rw-r--r--drivers/net/ethernet/arc/emac_rockchip.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c
index c31c7407b753..36e9eb1ee44c 100644
--- a/drivers/net/ethernet/arc/emac_rockchip.c
+++ b/drivers/net/ethernet/arc/emac_rockchip.c
@@ -164,10 +164,6 @@ static int emac_rockchip_probe(struct platform_device *pdev)
}
}
- err = arc_emac_probe(ndev, interface);
- if (err)
- goto out_regulator_disable;
-
/* write-enable bits */
data = GRF_MODE_ENABLE_BIT | GRF_SPEED_ENABLE_BIT;
@@ -184,6 +180,13 @@ static int emac_rockchip_probe(struct platform_device *pdev)
err = clk_set_rate(priv->refclk, 50000000);
if (err)
dev_err(dev, "failed to change reference clock rate (%d)\n", err);
+
+ err = arc_emac_probe(ndev, interface);
+ if (err) {
+ dev_err(dev, "failed to probe arc emac (%d)\n", err);
+ goto out_regulator_disable;
+ }
+
return 0;
out_regulator_disable: