diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-12-17 15:42:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-17 17:40:19 -0500 |
commit | ea01e8a4cdff627cbc417d1bf945bf34df9afa9d (patch) | |
tree | 84b7ddb7537a9732b6df665a0718a537b0ee1031 | |
parent | 20e9e78f8b0f1ed02a3a095240853b1767482757 (diff) |
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: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index e20a669c190c..db6a47d7b48c 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -399,7 +399,10 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) | |||
399 | } | 399 | } |
400 | 400 | ||
401 | /* Initialize hardware */ | 401 | /* Initialize hardware */ |
402 | clk_prepare_enable(bs->clk); | 402 | ret = clk_prepare_enable(bs->clk); |
403 | if (ret) | ||
404 | goto out_err; | ||
405 | |||
403 | bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS); | 406 | bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS); |
404 | 407 | ||
405 | /* register and we are done */ | 408 | /* register and we are done */ |
@@ -452,8 +455,11 @@ static int bcm63xx_spi_resume(struct device *dev) | |||
452 | { | 455 | { |
453 | struct spi_master *master = dev_get_drvdata(dev); | 456 | struct spi_master *master = dev_get_drvdata(dev); |
454 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); | 457 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
458 | int ret; | ||
455 | 459 | ||
456 | clk_prepare_enable(bs->clk); | 460 | ret = clk_prepare_enable(bs->clk); |
461 | if (ret) | ||
462 | return ret; | ||
457 | 463 | ||
458 | spi_master_resume(master); | 464 | spi_master_resume(master); |
459 | 465 | ||