diff options
| -rw-r--r-- | drivers/net/ethernet/qualcomm/emac/emac-phy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-phy.c b/drivers/net/ethernet/qualcomm/emac/emac-phy.c index 18461fcb9815..53dbf1e163a8 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac-phy.c +++ b/drivers/net/ethernet/qualcomm/emac/emac-phy.c | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #define MDIO_CLK_25_28 7 | 47 | #define MDIO_CLK_25_28 7 |
| 48 | 48 | ||
| 49 | #define MDIO_WAIT_TIMES 1000 | 49 | #define MDIO_WAIT_TIMES 1000 |
| 50 | #define MDIO_STATUS_DELAY_TIME 1 | ||
| 50 | 51 | ||
| 51 | static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum) | 52 | static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum) |
| 52 | { | 53 | { |
| @@ -65,7 +66,7 @@ static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum) | |||
| 65 | 66 | ||
| 66 | if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg, | 67 | if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg, |
| 67 | !(reg & (MDIO_START | MDIO_BUSY)), | 68 | !(reg & (MDIO_START | MDIO_BUSY)), |
| 68 | 100, MDIO_WAIT_TIMES * 100)) | 69 | MDIO_STATUS_DELAY_TIME, MDIO_WAIT_TIMES * 100)) |
| 69 | return -EIO; | 70 | return -EIO; |
| 70 | 71 | ||
| 71 | return (reg >> MDIO_DATA_SHFT) & MDIO_DATA_BMSK; | 72 | return (reg >> MDIO_DATA_SHFT) & MDIO_DATA_BMSK; |
| @@ -88,8 +89,8 @@ static int emac_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val) | |||
| 88 | writel(reg, adpt->base + EMAC_MDIO_CTRL); | 89 | writel(reg, adpt->base + EMAC_MDIO_CTRL); |
| 89 | 90 | ||
| 90 | if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg, | 91 | if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg, |
| 91 | !(reg & (MDIO_START | MDIO_BUSY)), 100, | 92 | !(reg & (MDIO_START | MDIO_BUSY)), |
| 92 | MDIO_WAIT_TIMES * 100)) | 93 | MDIO_STATUS_DELAY_TIME, MDIO_WAIT_TIMES * 100)) |
| 93 | return -EIO; | 94 | return -EIO; |
| 94 | 95 | ||
| 95 | return 0; | 96 | return 0; |
