spi: spi-orion: check return value from clk_prepare()/clk_enable()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 21 Jun 2014 10:32:23 +0000 (11:32 +0100)
committerMark Brown <broonie@linaro.org>
Sat, 21 Jun 2014 11:00:36 +0000 (12:00 +0100)
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>
drivers/spi/spi-orion.c

index d018a4aac3a18f818921a6d04226f1bf2fd703b1..24844984ef363bffdadd69c26e11f10c9628cb24 100644 (file)
@@ -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);