diff options
Diffstat (limited to 'arch/arm/mach-omap2/gpmc.c')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 7d687845f391..e86f5ca180ea 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -393,7 +393,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base) | |||
393 | if (r < 0) | 393 | if (r < 0) |
394 | goto out; | 394 | goto out; |
395 | 395 | ||
396 | gpmc_cs_enable_mem(cs, res->start, res->end - res->start + 1); | 396 | gpmc_cs_enable_mem(cs, res->start, resource_size(res)); |
397 | *base = res->start; | 397 | *base = res->start; |
398 | gpmc_cs_set_reserved(cs, 1); | 398 | gpmc_cs_set_reserved(cs, 1); |
399 | out: | 399 | out: |
@@ -405,7 +405,7 @@ EXPORT_SYMBOL(gpmc_cs_request); | |||
405 | void gpmc_cs_free(int cs) | 405 | void gpmc_cs_free(int cs) |
406 | { | 406 | { |
407 | spin_lock(&gpmc_mem_lock); | 407 | spin_lock(&gpmc_mem_lock); |
408 | if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) { | 408 | if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) { |
409 | printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); | 409 | printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); |
410 | BUG(); | 410 | BUG(); |
411 | spin_unlock(&gpmc_mem_lock); | 411 | spin_unlock(&gpmc_mem_lock); |