diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2009-11-03 06:53:41 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 19:19:00 -0400 |
commit | 0d813d9960444470c4bebb73c2bde6697543fee9 (patch) | |
tree | 51f9b4786f7b3c5c4152b0854b01ac211dd27fb8 /drivers/i2c | |
parent | 29412e69007c17d6866a50d0b65fb0d808824370 (diff) |
i2c-pxa: only define 'blue_murder'-function if DEBUG is #defined
This talkative function is also called on timeouts. As timeouts can
happen on regular writes to EEPROMs (no error case), this creates false
positives. Giving lots of details is interesting only for developers
anyhow, so just use the function if DEBUG is #defined.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 8862640c37f7..fbde6f614059 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -209,16 +209,6 @@ static void i2c_pxa_show_state(struct pxa_i2c *i2c, int lno, const char *fname) | |||
209 | } | 209 | } |
210 | 210 | ||
211 | #define show_state(i2c) i2c_pxa_show_state(i2c, __LINE__, __func__) | 211 | #define show_state(i2c) i2c_pxa_show_state(i2c, __LINE__, __func__) |
212 | #else | ||
213 | #define i2c_debug 0 | ||
214 | |||
215 | #define show_state(i2c) do { } while (0) | ||
216 | #define decode_ISR(val) do { } while (0) | ||
217 | #define decode_ICR(val) do { } while (0) | ||
218 | #endif | ||
219 | |||
220 | static void i2c_pxa_master_complete(struct pxa_i2c *i2c, int ret); | ||
221 | static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id); | ||
222 | 212 | ||
223 | static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why) | 213 | static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why) |
224 | { | 214 | { |
@@ -234,6 +224,20 @@ static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why) | |||
234 | printk("\n"); | 224 | printk("\n"); |
235 | } | 225 | } |
236 | 226 | ||
227 | #else /* ifdef DEBUG */ | ||
228 | |||
229 | #define i2c_debug 0 | ||
230 | |||
231 | #define show_state(i2c) do { } while (0) | ||
232 | #define decode_ISR(val) do { } while (0) | ||
233 | #define decode_ICR(val) do { } while (0) | ||
234 | #define i2c_pxa_scream_blue_murder(i2c, why) do { } while (0) | ||
235 | |||
236 | #endif /* ifdef DEBUG / else */ | ||
237 | |||
238 | static void i2c_pxa_master_complete(struct pxa_i2c *i2c, int ret); | ||
239 | static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id); | ||
240 | |||
237 | static inline int i2c_pxa_is_slavemode(struct pxa_i2c *i2c) | 241 | static inline int i2c_pxa_is_slavemode(struct pxa_i2c *i2c) |
238 | { | 242 | { |
239 | return !(readl(_ICR(i2c)) & ICR_SCLE); | 243 | return !(readl(_ICR(i2c)) & ICR_SCLE); |