Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159435
b: refs/heads/master
c: c60a5cf
h: refs/heads/master
i:
  159433: 36301c7
  159431: 5dc8baa
v: v3
  • Loading branch information
Atsushi Nemoto authored and David S. Miller committed Aug 6, 2009
1 parent 0992413 commit 76c42a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db30f5ef6e4471fd55671382b8870fdd61e35814
refs/heads/master: c60a5cf7af0a94cf8b09ca22796affa5f5f0669a
6 changes: 4 additions & 2 deletions trunk/drivers/net/tc35815.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,10 @@ static int tc_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
struct net_device *dev = bus->priv;
struct tc35815_regs __iomem *tr =
(struct tc35815_regs __iomem *)dev->base_addr;
unsigned long timeout = jiffies + 10;
unsigned long timeout = jiffies + HZ;

tc_writel(MD_CA_Busy | (mii_id << 5) | (regnum & 0x1f), &tr->MD_CA);
udelay(12); /* it takes 32 x 400ns at least */
while (tc_readl(&tr->MD_CA) & MD_CA_Busy) {
if (time_after(jiffies, timeout))
return -EIO;
Expand All @@ -610,11 +611,12 @@ static int tc_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 val)
struct net_device *dev = bus->priv;
struct tc35815_regs __iomem *tr =
(struct tc35815_regs __iomem *)dev->base_addr;
unsigned long timeout = jiffies + 10;
unsigned long timeout = jiffies + HZ;

tc_writel(val, &tr->MD_Data);
tc_writel(MD_CA_Busy | MD_CA_Wr | (mii_id << 5) | (regnum & 0x1f),
&tr->MD_CA);
udelay(12); /* it takes 32 x 400ns at least */
while (tc_readl(&tr->MD_CA) & MD_CA_Busy) {
if (time_after(jiffies, timeout))
return -EIO;
Expand Down

0 comments on commit 76c42a5

Please sign in to comment.