Message ID | E1WyIat-0008KL-Ju@rmk-PC.arm.linux.org.uk (mailing list archive) |
---|---|
State | Accepted |
Commit | c85012addd800d8fd135b9a871d5ce9b8e8c4081 |
Headers | show |
On Sat, Jun 21, 2014 at 11:32:23AM +0100, Russell King wrote: > 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(). Applied, thanks.
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) 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);
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> --- Patch generated against v3.15 drivers/spi/spi-orion.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)