Skip to content

Commit

Permalink
spi/omap2-mcspi: Trivial optimisation
Browse files Browse the repository at this point in the history
Trivial optimisation of tmp variable by directly writing the value
to the register.

Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
  • Loading branch information
Shubhrajyoti D authored and Grant Likely committed Apr 10, 2012
1 parent 27b5284 commit 39f8052
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/spi/spi-omap2-mcspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,16 +1050,15 @@ static int __init omap2_mcspi_master_setup(struct omap2_mcspi *mcspi)
{
struct spi_master *master = mcspi->master;
struct omap2_mcspi_regs *ctx = &mcspi->ctx;
u32 tmp;
int ret = 0;

ret = omap2_mcspi_enable_clocks(mcspi);
if (ret < 0)
return ret;

tmp = OMAP2_MCSPI_WAKEUPENABLE_WKEN;
mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE, tmp);
ctx->wakeupenable = tmp;
mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE,
OMAP2_MCSPI_WAKEUPENABLE_WKEN);
ctx->wakeupenable = OMAP2_MCSPI_WAKEUPENABLE_WKEN;

omap2_mcspi_set_master_mode(master);
omap2_mcspi_disable_clocks(mcspi);
Expand Down

0 comments on commit 39f8052

Please sign in to comment.