diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2013-02-12 14:22:24 -0500 |
---|---|---|
committer | Jon Hunter <jon-hunter@ti.com> | 2013-04-01 15:53:39 -0400 |
commit | f5d8edaf1d06e922a3c3d75c52ef5628ceec32c4 (patch) | |
tree | 03b4641f9dd634b99b8b19e2d3a42e57e7d3dccb /arch | |
parent | 7ab91596a55e05410fcaab6d7d066ce0e0d0a712 (diff) |
ARM: omap2: gpmc: Remove redundant chip select out of range check
This check is done before the call to gpmc_cs_reserved() and
gpmc_cs_set_reserved() and it's redundant to do it again in each
function. This simplifies the code a bit.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Reviewed-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 7c122bb5498a..586dba7e5f23 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -441,22 +441,14 @@ static int gpmc_cs_mem_enabled(int cs) | |||
441 | return l & GPMC_CONFIG7_CSVALID; | 441 | return l & GPMC_CONFIG7_CSVALID; |
442 | } | 442 | } |
443 | 443 | ||
444 | static int gpmc_cs_set_reserved(int cs, int reserved) | 444 | static void gpmc_cs_set_reserved(int cs, int reserved) |
445 | { | 445 | { |
446 | if (cs > GPMC_CS_NUM) | ||
447 | return -ENODEV; | ||
448 | |||
449 | gpmc_cs_map &= ~(1 << cs); | 446 | gpmc_cs_map &= ~(1 << cs); |
450 | gpmc_cs_map |= (reserved ? 1 : 0) << cs; | 447 | gpmc_cs_map |= (reserved ? 1 : 0) << cs; |
451 | |||
452 | return 0; | ||
453 | } | 448 | } |
454 | 449 | ||
455 | static bool gpmc_cs_reserved(int cs) | 450 | static bool gpmc_cs_reserved(int cs) |
456 | { | 451 | { |
457 | if (cs > GPMC_CS_NUM) | ||
458 | return true; | ||
459 | |||
460 | return gpmc_cs_map & (1 << cs); | 452 | return gpmc_cs_map & (1 << cs); |
461 | } | 453 | } |
462 | 454 | ||