diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-06-21 06:32:23 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-21 07:00:36 -0400 |
commit | c85012addd800d8fd135b9a871d5ce9b8e8c4081 (patch) | |
tree | cc5e6c320bfb34a59955733b9065bfe688be45c2 /drivers/spi/spi-orion.c | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
spi: spi-orion: check return value from clk_prepare()/clk_enable()
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>
Diffstat (limited to 'drivers/spi/spi-orion.c')
-rw-r--r-- | drivers/spi/spi-orion.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index d018a4aac3a1..24844984ef36 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c | |||
@@ -382,8 +382,10 @@ static int orion_spi_probe(struct platform_device *pdev) | |||
382 | goto out; | 382 | goto out; |
383 | } | 383 | } |
384 | 384 | ||
385 | clk_prepare(spi->clk); | 385 | status = clk_prepare_enable(spi->clk); |
386 | clk_enable(spi->clk); | 386 | if (status) |
387 | goto out; | ||
388 | |||
387 | tclk_hz = clk_get_rate(spi->clk); | 389 | tclk_hz = clk_get_rate(spi->clk); |
388 | master->max_speed_hz = DIV_ROUND_UP(tclk_hz, 4); | 390 | master->max_speed_hz = DIV_ROUND_UP(tclk_hz, 4); |
389 | master->min_speed_hz = DIV_ROUND_UP(tclk_hz, 30); | 391 | master->min_speed_hz = DIV_ROUND_UP(tclk_hz, 30); |