[U-Boot] [PATCH 2/3] net/tsec: convert the printf() to serial_printf()

Sebastian Andrzej Siewior bigeasy at linutronix.de
Fri Mar 23 21:11:18 CET 2012


In case we use netconsole for stdout and something goes wrong here and
we run into one of this printf() then there is no point of sending this
over network again since it is likely that will fail again.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
 drivers/net/tsec.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 160bc05..78badfa 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -199,7 +199,7 @@ static void adjust_link(struct tsec_private *priv, struct phy_device *phydev)
 	u32 ecntrl, maccfg2;
 
 	if (!phydev->link) {
-		printf("%s: No link.\n", phydev->dev->name);
+		serial_printf("%s: No link.\n", phydev->dev->name);
 		return;
 	}
 
@@ -228,14 +228,14 @@ static void adjust_link(struct tsec_private *priv, struct phy_device *phydev)
 			ecntrl |= ECNTRL_R100;
 		break;
 	default:
-		printf("%s: Speed was bad\n", phydev->dev->name);
+		serial_printf("%s: Speed was bad\n", phydev->dev->name);
 		break;
 	}
 
 	out_be32(&regs->ecntrl, ecntrl);
 	out_be32(&regs->maccfg2, maccfg2);
 
-	printf("Speed: %d, %s duplex%s\n", phydev->speed,
+	serial_printf("Speed: %d, %s duplex%s\n", phydev->speed,
 			(phydev->duplex) ? "full" : "half",
 			(phydev->port == PORT_FIBRE) ? ", fiber mode" : "");
 }
@@ -287,7 +287,7 @@ void redundant_init(struct eth_device *dev)
 		/* Wait for buffer to be received */
 		for (t = 0; rtx.rxbd[rxIdx].status & RXBD_EMPTY; t++) {
 			if (t >= 10 * TOUT_LOOP) {
-				printf("%s: tsec: rx error\n", dev->name);
+				serial_printf("%s: tsec: rx error\n", dev->name);
 				break;
 			}
 		}
@@ -305,7 +305,7 @@ void redundant_init(struct eth_device *dev)
 			out_be32(&regs->rstat, RSTAT_CLEAR_RHALT);
 		}
 		if (fail) {
-			printf("loopback recv packet error!\n");
+			serial_printf("loopback recv packet error!\n");
 			clrbits_be32(&regs->maccfg1, MACCFG1_RX_EN);
 			udelay(1000);
 			setbits_be32(&regs->maccfg1, MACCFG1_RX_EN);
@@ -428,7 +428,7 @@ static int tsec_recv(struct eth_device *dev)
 		if (!(rtx.rxbd[rxIdx].status & RXBD_STATS)) {
 			NetReceive(NetRxPackets[rxIdx], length - 4);
 		} else {
-			printf("Got error %x\n",
+			serial_printf("Got error %x\n",
 			       (rtx.rxbd[rxIdx].status & RXBD_STATS));
 		}
 
-- 
1.7.9.1



More information about the U-Boot mailing list