[U-Boot] [POWERPC] mgsuvd: fix compiler warning when using soft_i2c driver

Heiko Schocher hs at denx.de
Thu Oct 16 19:11:42 CEST 2008


following patch solves the compiler warning for the
mgsuvd board, using the soft_i2c driver:

[hs at pollux u-boot]$ ./MAKEALL mgsuvd
Configuring for mgsuvd board...
soft_i2c.c: In function 'write_byte':
soft_i2c.c:209: warning: implicit declaration of function 'i2c_soft_read_pin'
   text    data     bss     dec     hex filename
 174608    9712   28436  212756   33f14 ./u-boot
[hs at pollux u-boot]$

Signed-off-by: Heiko Schocher <hs at denx.de>
---
 drivers/i2c/soft_i2c.c   |    2 ++
 include/configs/mgsuvd.h |    1 +
 include/i2c.h            |    4 ++++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
index 0a9feb6..346125e 100644
--- a/drivers/i2c/soft_i2c.c
+++ b/drivers/i2c/soft_i2c.c
@@ -41,6 +41,8 @@
 #endif
 #include <i2c.h>

+CONFIG_I2C_SOFT_EXTERN
+
 /* #define	DEBUG_I2C	*/

 #ifdef DEBUG_I2C
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index 4ecaeac..2171115 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -356,6 +356,7 @@

 #define I2C_ACTIVE	do {} while (0)
 #define I2C_TRISTATE	do {} while (0)
+#define CONFIG_I2C_SOFT_EXTERN	extern int i2c_soft_read_pin (void);
 #define I2C_READ	i2c_soft_read_pin ()
 #define I2C_SDA(bit)	if(bit) { \
 				*(unsigned short *)(I2C_BASE_DIR) &=  ~SDA_CONF; \
diff --git a/include/i2c.h b/include/i2c.h
index 9f771dd..24d535f 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -76,6 +76,10 @@
 #  define I2C_SOFT_DECLARATIONS
 # endif
 #endif
+
+#ifndef CONFIG_I2C_SOFT_EXTERN
+#define CONFIG_I2C_SOFT_EXTERN
+#endif
 /*
  * Initialization, must be called once on start up, may be called
  * repeatedly to change the speed and slave addresses.
-- 
1.5.6.1

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list