From 98aed379586a155292efbf3209356836584b601c Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Wed, 15 Oct 2008 09:35:26 +0200 Subject: soft_i2c: prevent compiler warnings if driver does not use CPU Pins. This patch fixes the following warnings, when using the soft_i2c driver using no CPU pins on MPC82xx or MPC8xx systems: soft_i2c.c: In function 'send_reset': soft_i2c.c:93: warning: unused variable 'immr' soft_i2c.c: In function 'send_start': soft_i2c.c:124: warning: unused variable 'immr' soft_i2c.c: In function 'send_stop': soft_i2c.c:146: warning: unused variable 'immr' soft_i2c.c: In function 'send_ack': soft_i2c.c:171: warning: unused variable 'immr' soft_i2c.c: In function 'write_byte': soft_i2c.c:196: warning: unused variable 'immr' soft_i2c.c: In function 'read_byte': soft_i2c.c:244: warning: unused variable 'immr' Signed-off-by: Heiko Schocher --- include/i2c.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/i2c.h') diff --git a/include/i2c.h b/include/i2c.h index a51c16464..a6e797a38 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -67,6 +67,15 @@ #define CFG_SPD_BUS_NUM 0 #endif +#ifndef I2C_SOFT_DECLARATIONS +# if defined(CONFIG_MPC8260) +# define I2C_SOFT_DECLARATIONS volatile ioport_t *iop = ioport_addr((immap_t *)CFG_IMMR, I2C_PORT); +# elif defined(CONFIG_8xx) +# define I2C_SOFT_DECLARATIONS volatile immap_t *immr = (immap_t *)CFG_IMMR; +# else +# define I2C_SOFT_DECLARATIONS +# endif +#endif /* * Initialization, must be called once on start up, may be called * repeatedly to change the speed and slave addresses. -- cgit v1.2.3