diff options
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 5fa3755261ce..45f680f965ed 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -283,13 +283,8 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p) | |||
283 | p->cycle2cyclediffcsen); | 283 | p->cycle2cyclediffcsen); |
284 | } | 284 | } |
285 | 285 | ||
286 | #ifdef DEBUG | ||
287 | static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, | 286 | static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, |
288 | int time, const char *name) | 287 | int time, const char *name) |
289 | #else | ||
290 | static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, | ||
291 | int time) | ||
292 | #endif | ||
293 | { | 288 | { |
294 | u32 l; | 289 | u32 l; |
295 | int ticks, mask, nr_bits; | 290 | int ticks, mask, nr_bits; |
@@ -299,15 +294,15 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, | |||
299 | else | 294 | else |
300 | ticks = gpmc_ns_to_ticks(time); | 295 | ticks = gpmc_ns_to_ticks(time); |
301 | nr_bits = end_bit - st_bit + 1; | 296 | nr_bits = end_bit - st_bit + 1; |
302 | if (ticks >= 1 << nr_bits) { | 297 | mask = (1 << nr_bits) - 1; |
303 | #ifdef DEBUG | 298 | |
304 | printk(KERN_INFO "GPMC CS%d: %-10s* %3d ns, %3d ticks >= %d\n", | 299 | if (ticks > mask) { |
305 | cs, name, time, ticks, 1 << nr_bits); | 300 | pr_err("%s: GPMC error! CS%d: %s: %d ns, %d ticks > %d\n", |
306 | #endif | 301 | __func__, cs, name, time, ticks, mask); |
302 | |||
307 | return -1; | 303 | return -1; |
308 | } | 304 | } |
309 | 305 | ||
310 | mask = (1 << nr_bits) - 1; | ||
311 | l = gpmc_cs_read_reg(cs, reg); | 306 | l = gpmc_cs_read_reg(cs, reg); |
312 | #ifdef DEBUG | 307 | #ifdef DEBUG |
313 | printk(KERN_INFO | 308 | printk(KERN_INFO |
@@ -322,16 +317,10 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, | |||
322 | return 0; | 317 | return 0; |
323 | } | 318 | } |
324 | 319 | ||
325 | #ifdef DEBUG | ||
326 | #define GPMC_SET_ONE(reg, st, end, field) \ | 320 | #define GPMC_SET_ONE(reg, st, end, field) \ |
327 | if (set_gpmc_timing_reg(cs, (reg), (st), (end), \ | 321 | if (set_gpmc_timing_reg(cs, (reg), (st), (end), \ |
328 | t->field, #field) < 0) \ | 322 | t->field, #field) < 0) \ |
329 | return -1 | 323 | return -1 |
330 | #else | ||
331 | #define GPMC_SET_ONE(reg, st, end, field) \ | ||
332 | if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field) < 0) \ | ||
333 | return -1 | ||
334 | #endif | ||
335 | 324 | ||
336 | int gpmc_calc_divider(unsigned int sync_clk) | 325 | int gpmc_calc_divider(unsigned int sync_clk) |
337 | { | 326 | { |