Skip to content

Commit

Permalink
ARM: omap2: gpmc: Remove redundant chip select out of range check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ezequiel Garcia authored and Jon Hunter committed Apr 1, 2013
1 parent 7ab9159 commit f5d8eda
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions arch/arm/mach-omap2/gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,22 +441,14 @@ static int gpmc_cs_mem_enabled(int cs)
return l & GPMC_CONFIG7_CSVALID;
}

static int gpmc_cs_set_reserved(int cs, int reserved)
static void gpmc_cs_set_reserved(int cs, int reserved)
{
if (cs > GPMC_CS_NUM)
return -ENODEV;

gpmc_cs_map &= ~(1 << cs);
gpmc_cs_map |= (reserved ? 1 : 0) << cs;

return 0;
}

static bool gpmc_cs_reserved(int cs)
{
if (cs > GPMC_CS_NUM)
return true;

return gpmc_cs_map & (1 << cs);
}

Expand Down

0 comments on commit f5d8eda

Please sign in to comment.