提交 ea01e8a4 编写于 作者: J Jonas Gorski 提交者: Mark Brown

spi/bcm63xx: check return value of clk_prepare_enable

Ensure we notice if the clock cannot be enabled for any reason and pass
the error down.
Signed-off-by: NJonas Gorski <jogo@openwrt.org>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 20e9e78f
...@@ -399,7 +399,10 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) ...@@ -399,7 +399,10 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
} }
/* Initialize hardware */ /* Initialize hardware */
clk_prepare_enable(bs->clk); ret = clk_prepare_enable(bs->clk);
if (ret)
goto out_err;
bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS); bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS);
/* register and we are done */ /* register and we are done */
...@@ -452,8 +455,11 @@ static int bcm63xx_spi_resume(struct device *dev) ...@@ -452,8 +455,11 @@ static int bcm63xx_spi_resume(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct bcm63xx_spi *bs = spi_master_get_devdata(master); struct bcm63xx_spi *bs = spi_master_get_devdata(master);
int ret;
clk_prepare_enable(bs->clk); ret = clk_prepare_enable(bs->clk);
if (ret)
return ret;
spi_master_resume(master); spi_master_resume(master);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册