All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: David Miller <davem@davemloft.net>,
	Joe Chou <Joe.Chou@rdc.com.tw>, Jeff Garzik <jeff@garzik.org>,
	netdev@vger.kernel.org
Subject: [PATCH 1/3] r6040: fix wrong logic in mdio code
Date: Fri, 19 Dec 2008 11:02:05 +0100	[thread overview]
Message-ID: <200812191102.05810.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

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 10:02 Florian Fainelli [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-12-19  9:56 [PATCH 1/3] r6040: fix wrong logic in mdio code Florian Fainelli
2008-12-23  3:42 ` David Miller

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=200812191102.05810.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.