netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, Joe Chou <Joe.Chou@rdc.com.tw>,
	Jeff Garzik <jeff@garzik.org>
Subject: [PATCH 1/3] r6040: fix wrong logic in mdio code
Date: Fri, 19 Dec 2008 10:56:20 +0100	[thread overview]
Message-ID: <200812191056.21176.florian@openwrt.org> (raw)

Hello David, Jeff,

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

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>
---
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 34fe7ef..c2e8ac1 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -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;
 	}
 }

             reply	other threads:[~2008-12-19 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19  9:56 Florian Fainelli [this message]
2008-12-23  3:42 ` [PATCH 1/3] r6040: fix wrong logic in mdio code David Miller
  -- strict thread matches above, loose matches on Subject: below --
2008-12-19 10:02 Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200812191056.21176.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=Joe.Chou@rdc.com.tw \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).