]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
r6040: fix wrong logic in mdio code
authorJoe Chou <Joe.Chou@rdc.com.tw>
Tue, 23 Dec 2008 03:38:17 +0000 (19:38 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 25 Jan 2009 00:41:42 +0000 (16:41 -0800)
[ Upstream commit: 11e5e8f5d14a1229706576184d2cf4c4556ed94c ]

This patch fixes a reverse logic in the MDIO code.

Signed-off-by: Joe Chou <Joe.Chou@rdc.com.tw>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/r6040.c

index 34fe7ef8e5edf637c1f3c5f301c944e08f598076..c2e8ac12e6736903cf80ecb66bc4628c092ae948 100644 (file)
@@ -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;
        }
 }