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 2/4] net: cpsw: print slave_num in dev_dbg
Date: Thu, 15 May 2014 08:56:54 +0200	[thread overview]
Message-ID: <1400137016-15688-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1400137016-15688-1-git-send-email-s.hauer@pengutronix.de>

Since the cpsw has two slaves which handle one network interface
each the slave number is interesting during debugging. Print the
number.

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

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index f11b2d9..46fa53d 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -542,7 +542,7 @@ static int cpsw_get_hwaddr(struct eth_device *edev, unsigned char *mac)
 	struct cpsw_slave *slave = edev->priv;
 	struct cpsw_priv *priv = slave->cpsw;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	return -1;
 }
@@ -552,7 +552,7 @@ static int cpsw_set_hwaddr(struct eth_device *edev, unsigned char *mac)
 	struct cpsw_slave *slave = edev->priv;
 	struct cpsw_priv *priv = slave->cpsw;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	memcpy(&priv->mac_addr, mac, sizeof(priv->mac_addr));
 
@@ -568,7 +568,7 @@ static void cpsw_slave_update_link(struct cpsw_slave *slave,
 	struct phy_device *phydev = slave->edev.phydev;
 	u32 mac_control = 0;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	if (!phydev)
 		return;
@@ -609,7 +609,7 @@ static int cpsw_update_link(struct cpsw_slave *slave, struct cpsw_priv *priv)
 {
 	int link = 0;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	cpsw_slave_update_link(slave, priv, &link);
 
@@ -621,7 +621,7 @@ static void cpsw_adjust_link(struct eth_device *edev)
 	struct cpsw_slave *slave = edev->priv;
 	struct cpsw_priv *priv = slave->cpsw;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	cpsw_update_link(slave, priv);
 }
@@ -638,7 +638,7 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv)
 {
 	u32	slave_port;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	soft_reset(priv, &slave->sliver->soft_reset);
 
@@ -769,7 +769,7 @@ static int cpsw_open(struct eth_device *edev)
 	struct cpsw_priv *priv = slave->cpsw;
 	int i, ret;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	ret = phy_device_connect(edev, &priv->miibus, slave->phy_id,
 				 cpsw_adjust_link, 0, slave->phy_if);
@@ -855,6 +855,8 @@ static void cpsw_halt(struct eth_device *edev)
 	struct cpsw_slave *slave = edev->priv;
 	struct cpsw_priv *priv = slave->cpsw;
 
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
+
 	writel(0, priv->dma_regs + CPDMA_TXCONTROL);
 	writel(0, priv->dma_regs + CPDMA_RXCONTROL);
 
@@ -872,7 +874,7 @@ static int cpsw_send(struct eth_device *edev, void *packet, int length)
 	void *buffer;
 	int ret, len;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	/* first reap completed packets */
 	while (cpdma_process(priv, &priv->tx_chan, &buffer, &len) >= 0);
@@ -917,7 +919,7 @@ static int cpsw_slave_setup(struct cpsw_slave *slave, int slave_num,
 	void			*regs = priv->regs;
 	struct eth_device	*edev = &slave->edev;
 
-	dev_dbg(priv->dev, "* %s\n", __func__);
+	dev_dbg(priv->dev, "* %s slave %d\n", __func__, slave->slave_num);
 
 	slave->slave_num = slave_num;
 	slave->regs	= regs + priv->slave_ofs + priv->slave_size * slave_num;
-- 
2.0.0.rc0


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

  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 ` Sascha Hauer [this message]
2014-05-15  6:56 ` [PATCH 3/4] net: cpsw: Always write mac_control register Sascha Hauer
2014-05-15  6:56 ` [PATCH 4/4] net: cpsw: Allow multiple slaves 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=1400137016-15688-2-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