From: "Teresa Gámez" <t.gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/6] net: cpsw: Fix probe for one port ethernet
Date: Fri, 10 Oct 2014 11:14:29 +0200 [thread overview]
Message-ID: <1412932473-38216-2-git-send-email-t.gamez@phytec.de> (raw)
In-Reply-To: <1412932473-38216-1-git-send-email-t.gamez@phytec.de>
If only one port is pinned out, probe fails
as the second port phy_id is not found.
Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
drivers/net/cpsw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 167b2dd..9c8cff3 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1071,7 +1071,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
return ret;
}
- if (!strncmp(child->name, "slave", 5)) {
+ if (i < priv->num_slaves && !strncmp(child->name, "slave", 5)) {
struct cpsw_slave *slave = &priv->slaves[i];
uint32_t phy_id[2];
@@ -1088,7 +1088,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
}
}
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < priv->num_slaves; i++) {
struct cpsw_slave *slave = &priv->slaves[i];
cpsw_gmii_sel_am335x(slave);
--
1.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-10-10 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 9:14 [PATCH 1/6] ARM: defconfig: Enable of_display_timings in am335x_defconfig Teresa Gámez
2014-10-10 9:14 ` Teresa Gámez [this message]
2014-10-10 9:14 ` [PATCH 3/6] phyCORE-AM335x: Update default enviroment Teresa Gámez
2014-10-10 9:14 ` [PATCH 4/6] phyCORE-AM335x: Strip down device tree Teresa Gámez
2014-10-10 9:14 ` [PATCH 5/6] ARM: dts: split phyCORE-AM335x " Teresa Gámez
2014-10-10 9:14 ` [PATCH 6/6] phyCORE-AM335x: Add barebox image without SPI NOR Teresa Gámez
2014-10-14 9:23 ` [PATCH 1/6] ARM: defconfig: Enable of_display_timings in am335x_defconfig Sascha Hauer
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=1412932473-38216-2-git-send-email-t.gamez@phytec.de \
--to=t.gamez@phytec.de \
--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