linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] net/fec: fix fec1 check in fec_enet_mii_init()
Date: Wed, 21 Sep 2011 19:10:31 +0800	[thread overview]
Message-ID: <1316603432-20032-3-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1316603432-20032-1-git-send-email-shawn.guo@linaro.org>

In function fec_enet_mii_init(), it uses non-zero pdev->id as part
of the condition to check the second fec instance (fec1).  This works
before the driver supports device tree probe.  But in case of device
tree probe, pdev->id is -1 which is also non-zero, so the logic becomes
broken when device tree probe gets supported.

The patch change the logic to check "pdev->id > 0" as the part of the
condition for identifying fec1.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/ethernet/freescale/fec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index a057abf..ca6f551 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -996,7 +996,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 	 * mdio interface in board design, and need to be configured by
 	 * fec0 mii_bus.
 	 */
-	if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) {
+	if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
 		/* fec1 uses fec0 mii_bus */
 		fep->mii_bus = fec0_mii_bus;
 		return 0;
-- 
1.7.4.1

  parent reply	other threads:[~2011-09-21 11:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 11:10 [PATCH v2 0/3] add fec support for imx6q Shawn Guo
2011-09-21 11:10 ` [PATCH v2 1/3] net/fec: change phy-reset-gpio request warning to debug message Shawn Guo
2011-09-21 11:25   ` Wolfram Sang
2011-09-21 12:03     ` Shawn Guo
2011-09-21 12:11       ` Wolfram Sang
2011-09-21 12:44         ` Shawn Guo
2011-09-21 12:59           ` Wolfram Sang
2011-09-21 13:18             ` Shawn Guo
2011-09-21 11:10 ` Shawn Guo [this message]
2011-09-21 11:10 ` [PATCH v2 3/3] net/fec: add imx6q enet support Shawn Guo
2011-09-21 11:07   ` Fabio Estevam
2011-09-21 11:28     ` Shawn Guo
2011-09-21 11:32   ` Wolfram Sang
2011-09-21 11:58     ` Shawn Guo
2011-09-21 12:26       ` Wolfram Sang

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=1316603432-20032-3-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).