mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] net: cpsw: Allow multiple slaves
Date: Thu, 15 May 2014 08:56:56 +0200	[thread overview]
Message-ID: <1400137016-15688-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1400137016-15688-1-git-send-email-s.hauer@pengutronix.de>

The driver is ready now for handling both slaved, so add support
for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/cpsw.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index d31cbb6..d55f62a 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -572,9 +572,6 @@ static void cpsw_slave_update_link(struct cpsw_slave *slave,
 	if (!phydev)
 		return;
 
-	if (slave->slave_num)
-		return;
-
 	if (phydev->link) {
 		*link = 1;
 		mac_control = BIT(5); /* MIIEN */
@@ -1086,9 +1083,6 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
 		cpsw_gmii_sel_am335x(slave);
 	}
 
-	/* Only one slave supported by this driver */
-	priv->num_slaves = 1;
-
 	return 0;
 }
 
@@ -1100,7 +1094,7 @@ int cpsw_probe(struct device_d *dev)
 	uint64_t start;
 	uint32_t phy_mask;
 	struct cpsw_data *cpsw_data;
-	int ret;
+	int i, ret;
 
 	dev_dbg(dev, "* %s\n", __func__);
 
@@ -1192,9 +1186,11 @@ int cpsw_probe(struct device_d *dev)
 
 	mdiobus_register(&priv->miibus);
 
-	ret = cpsw_slave_setup(&priv->slaves[0], 0, priv);
-	if (ret)
-		goto out;
+	for (i = 0; i < priv->num_slaves; i++) {
+		ret = cpsw_slave_setup(&priv->slaves[i], i, priv);
+		if (ret)
+			goto out;
+	}
 
 	return 0;
 out:
-- 
2.0.0.rc0


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

      parent reply	other threads:[~2014-05-15  6:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15  6:56 [PATCH 1/4] net: cpsw: Pass correct slave Sascha Hauer
2014-05-15  6:56 ` [PATCH 2/4] net: cpsw: print slave_num in dev_dbg Sascha Hauer
2014-05-15  6:56 ` [PATCH 3/4] net: cpsw: Always write mac_control register Sascha Hauer
2014-05-15  6:56 ` Sascha Hauer [this message]

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=1400137016-15688-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.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