From: Jonas Gorski Date: Tue, 17 Dec 2013 20:42:09 +0000 (+0100) Subject: spi/bcm63xx: check return value of clk_prepare_enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea01e8a4cdff627cbc417d1bf945bf34df9afa9d;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Mark Brown --- 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) } /* 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); /* register and we are done */ @@ -452,8 +455,11 @@ static int bcm63xx_spi_resume(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); 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);