From e3e454cd72f319908355427b1a3ae54b3dd53356 Mon Sep 17 00:00:00 2001 From: Graeme Russ Date: Mon, 29 Aug 2011 02:14:05 +0000 Subject: console: Squelch pre-console output in console functions There are some locations in the code which anticipate printf() being called before the console is ready by squelching printf() on gd->have_console. Move this squelching into printf(), vprintf(), puts() and putc(). Also make tstc() and getc() return 0 if console is not yet initialised Signed-off-by: Graeme Russ Tested-by: Simon Glass --- drivers/i2c/ppc4xx_i2c.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/i2c/ppc4xx_i2c.c') diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c index c1cbe55..53fedd5 100644 --- a/drivers/i2c/ppc4xx_i2c.c +++ b/drivers/i2c/ppc4xx_i2c.c @@ -396,10 +396,7 @@ static int ppc4xx_i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, #endif if ((ret = i2c_transfer(read, chip << 1, &xaddr[4 - alen], alen, buffer, len)) != 0) { - if (gd->have_console) { - printf("I2C %s: failed %d\n", - read ? "read" : "write", ret); - } + printf("I2C %s: failed %d\n", read ? "read" : "write", ret); return 1; } -- cgit v1.1