Skip to contentSkip to conversation

r6040: fix wrong logic in mdio code

PATCH In review Florian Fainelli 2 participants 2 messages Dec 19, 2008 – Dec 23, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 r6040: fix wrong logic in mdio code

Hello David, Jeff,

Those patches should be applied to -stable as well. --
From: Florian Fainelli <[email protected]>
Subject: [PATCH 1/3] r6040: fix wrong logic in mdio code

This patch fixes a reverse logic in the MDIO code.

---

drivers/net/r6040.c +2 -2
index 34fe7ef..c2e8ac1 100644
@@ -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;
 	}
 }
maintainer
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Fri, 19 Dec 2008 10:56:20 +0100

Quoted 1 line

Those patches should be applied to -stable as well.

I've applied all 3 patches to net-next-2.6 and will queue them up for -stable as well, thanks.