diff options
-rw-r--r-- | drivers/net/tc35815.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c index 62965d6665d2..f42aaf72cc95 100644 --- a/drivers/net/tc35815.c +++ b/drivers/net/tc35815.c | |||
@@ -594,9 +594,10 @@ static int tc_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
594 | struct net_device *dev = bus->priv; | 594 | struct net_device *dev = bus->priv; |
595 | struct tc35815_regs __iomem *tr = | 595 | struct tc35815_regs __iomem *tr = |
596 | (struct tc35815_regs __iomem *)dev->base_addr; | 596 | (struct tc35815_regs __iomem *)dev->base_addr; |
597 | unsigned long timeout = jiffies + 10; | 597 | unsigned long timeout = jiffies + HZ; |
598 | 598 | ||
599 | tc_writel(MD_CA_Busy | (mii_id << 5) | (regnum & 0x1f), &tr->MD_CA); | 599 | tc_writel(MD_CA_Busy | (mii_id << 5) | (regnum & 0x1f), &tr->MD_CA); |
600 | udelay(12); /* it takes 32 x 400ns at least */ | ||
600 | while (tc_readl(&tr->MD_CA) & MD_CA_Busy) { | 601 | while (tc_readl(&tr->MD_CA) & MD_CA_Busy) { |
601 | if (time_after(jiffies, timeout)) | 602 | if (time_after(jiffies, timeout)) |
602 | return -EIO; | 603 | return -EIO; |
@@ -610,11 +611,12 @@ static int tc_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 val) | |||
610 | struct net_device *dev = bus->priv; | 611 | struct net_device *dev = bus->priv; |
611 | struct tc35815_regs __iomem *tr = | 612 | struct tc35815_regs __iomem *tr = |
612 | (struct tc35815_regs __iomem *)dev->base_addr; | 613 | (struct tc35815_regs __iomem *)dev->base_addr; |
613 | unsigned long timeout = jiffies + 10; | 614 | unsigned long timeout = jiffies + HZ; |
614 | 615 | ||
615 | tc_writel(val, &tr->MD_Data); | 616 | tc_writel(val, &tr->MD_Data); |
616 | tc_writel(MD_CA_Busy | MD_CA_Wr | (mii_id << 5) | (regnum & 0x1f), | 617 | tc_writel(MD_CA_Busy | MD_CA_Wr | (mii_id << 5) | (regnum & 0x1f), |
617 | &tr->MD_CA); | 618 | &tr->MD_CA); |
619 | udelay(12); /* it takes 32 x 400ns at least */ | ||
618 | while (tc_readl(&tr->MD_CA) & MD_CA_Busy) { | 620 | while (tc_readl(&tr->MD_CA) & MD_CA_Busy) { |
619 | if (time_after(jiffies, timeout)) | 621 | if (time_after(jiffies, timeout)) |
620 | return -EIO; | 622 | return -EIO; |