Skip to contentSkip to conversation

net/fsl: remove hardcoded clock setting from xgmac_mdio

PATCH Applied [email protected] 2 participants 2 messages Dec 30, 2014 – Jan 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 3/3 net/fsl: remove hardcoded clock setting from xgmac_mdio

From: Shaohui Xie <[email protected]>

There is no need to set the clock speed in read/write which will be performed unnecessarily for each mdio access. Init it during probe is enough.

Also, the hardcoded clock value is not a proper way for all SoCs.

---
changes in v2:
no change.

 drivers/net/ethernet/freescale/xgmac_mdio.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/net/ethernet/freescale/xgmac_mdio.c +0 -14
index 72e0b85..f8c3bc0 100644
@@ -94,13 +94,6 @@ static int xgmac_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 val
 	uint16_t dev_addr = regnum >> 16;
 	int ret;
 
-	/* Setup the MII Mgmt clock speed */
-	out_be32(&regs->mdio_stat, MDIO_STAT_CLKDIV(100));
-
-	ret = xgmac_wait_until_free(&bus->dev, regs);
-	if (ret)
-		return ret;
-
 	/* Set the port and dev addr */
 	out_be32(&regs->mdio_ctl,
 		 MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr));
@@ -135,13 +128,6 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
 	uint16_t value;
 	int ret;
 
-	/* Setup the MII Mgmt clock speed */
-	out_be32(&regs->mdio_stat, MDIO_STAT_CLKDIV(100));
-
-	ret = xgmac_wait_until_free(&bus->dev, regs);
-	if (ret)
-		return ret;
-
 	/* Set the Port and Device Addrs */
 	mdio_ctl = MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr);
 	out_be32(&regs->mdio_ctl, mdio_ctl);
Signature · 1 line
1.8.4.1
maintainer Applied
#1 lore raw

From: <[email protected]>
Date: Tue, 30 Dec 2014 16:28:21 +0800

Quoted 8 lines

From: Shaohui Xie <[email protected]>

There is no need to set the clock speed in read/write which will be performed unnecessarily for each mdio access. Init it during probe is enough.

Also, the hardcoded clock value is not a proper way for all SoCs.

Applied to net-next.