mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH] cpsw: fix dt probe for one port ethernet
Date: Thu, 12 Dec 2013 08:21:04 +0100	[thread overview]
Message-ID: <1386832864-6082-1-git-send-email-alex.aring@gmail.com> (raw)

Taken from linux-omap mailinglist. See:

http://marc.info/?l=linux-omap&m=138682143215842&w=2

Original commit-msg:

When only one port of the two port is pinned out, then dt probe is failing
because second port phy is not found. fixing this by checking the number of
slaves and breaking the loop.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
I think we need this, too. Only compile tested.

 drivers/net/cpsw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 5e68e1b..f82117c 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1076,6 +1076,8 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
 			slave->phy_if = of_get_phy_mode(child);
 
 			i++;
+			if (i == priv->num_slaves)
+				break;
 		}
 	}
 
-- 
1.8.4.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2013-12-12  7:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1386832864-6082-1-git-send-email-alex.aring@gmail.com \
    --to=alex.aring@gmail.com \
    --cc=barebox@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