summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2011-08-29 02:14:05 +0000
committerSimon Glass <sjg@chromium.org>2011-10-04 14:47:54 -0700
commit56380ae05fc0b667d753528f764f3bb1144627c4 (patch)
treed8e99be14df741e96644ca4e68b14a4d4d10daf2 /drivers
parente16e7f0ba3e81f07ba877479b91388160dd2aa46 (diff)
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 <graeme.russ@gmail.com> Change-Id: If62863017eaa48915b721675a5d520f9caa7e5e0 Reviewed-on: http://gerrit.chromium.org/gerrit/8685 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/ppc4xx_i2c.c5
-rw-r--r--drivers/i2c/soft_i2c.c1
2 files changed, 1 insertions, 5 deletions
diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
index c1cbe55bb9..53fedd594c 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;
}
diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 9b02e89e03..36c6114e3c 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -119,7 +119,6 @@ DECLARE_GLOBAL_DATA_PTR;
#ifdef DEBUG_I2C
#define PRINTD(fmt,args...) do { \
- if (gd->have_console) \
printf (fmt ,##args); \
} while (0)
#else