提交 c85012ad 编写于 作者: R Russell King 提交者: Mark Brown

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: NRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 7171511e
...@@ -382,8 +382,10 @@ static int orion_spi_probe(struct platform_device *pdev) ...@@ -382,8 +382,10 @@ static int orion_spi_probe(struct platform_device *pdev)
goto out; goto out;
} }
clk_prepare(spi->clk); status = clk_prepare_enable(spi->clk);
clk_enable(spi->clk); if (status)
goto out;
tclk_hz = clk_get_rate(spi->clk); tclk_hz = clk_get_rate(spi->clk);
master->max_speed_hz = DIV_ROUND_UP(tclk_hz, 4); master->max_speed_hz = DIV_ROUND_UP(tclk_hz, 4);
master->min_speed_hz = DIV_ROUND_UP(tclk_hz, 30); master->min_speed_hz = DIV_ROUND_UP(tclk_hz, 30);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册