Skip to content

Commit

Permalink
spi: spi-orion: check return value from clk_prepare()/clk_enable()
Browse files Browse the repository at this point in the history
clk_prepare()/clk_enable() can fail, and it's return value should
be checked.  Add the proper checking, and while we're here, convert
to clk_prepare_enable().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Russell King authored and Mark Brown committed Jun 21, 2014
1 parent 7171511 commit c85012a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/spi/spi-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,10 @@ static int orion_spi_probe(struct platform_device *pdev)
goto out;
}

clk_prepare(spi->clk);
clk_enable(spi->clk);
status = clk_prepare_enable(spi->clk);
if (status)
goto out;

tclk_hz = clk_get_rate(spi->clk);
master->max_speed_hz = DIV_ROUND_UP(tclk_hz, 4);
master->min_speed_hz = DIV_ROUND_UP(tclk_hz, 30);
Expand Down

0 comments on commit c85012a

Please sign in to comment.