Commit 11e5e8f5 authored by Joe Chou's avatar Joe Chou Committed by David S. Miller

r6040: fix wrong logic in mdio code

This patch fixes a reverse logic in the MDIO code.
Signed-off-by: default avatarJoe Chou <Joe.Chou@rdc.com.tw>
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f2f6da7
......@@ -214,7 +214,7 @@ static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg)
/* Wait for the read bit to be cleared */
while (limit--) {
cmd = ioread16(ioaddr + MMDIO);
if (cmd & MDIO_READ)
if (!(cmd & MDIO_READ))
break;
}
......@@ -233,7 +233,7 @@ static void r6040_phy_write(void __iomem *ioaddr, int phy_addr, int reg, u16 val
/* Wait for the write bit to be cleared */
while (limit--) {
cmd = ioread16(ioaddr + MMDIO);
if (cmd & MDIO_WRITE)
if (!(cmd & MDIO_WRITE))
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment