summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-08-23 08:33:39 +0800
committerMark Brown <broonie@linaro.org>2013-08-23 10:36:58 +0100
commit6cca9e2dd01adfa46a3b81f54f80d318714da418 (patch)
treee6a942217229c8edb4f37176f48043e4b735d546 /drivers/spi
parent2479790b2970ee386174431af2ad9c948b328b95 (diff)
downloadop-kernel-dev-6cca9e2dd01adfa46a3b81f54f80d318714da418.zip
op-kernel-dev-6cca9e2dd01adfa46a3b81f54f80d318714da418.tar.gz
spi: sirf: fix error return code in spi_sirfsoc_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-sirf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 546fae2..acfca88 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -650,12 +650,14 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
(void *)rx_dma_ch);
if (!sspi->rx_chan) {
dev_err(&pdev->dev, "can not allocate rx dma channel\n");
+ ret = -ENODEV;
goto free_master;
}
sspi->tx_chan = dma_request_channel(dma_cap_mask, (dma_filter_fn)sirfsoc_dma_filter_id,
(void *)tx_dma_ch);
if (!sspi->tx_chan) {
dev_err(&pdev->dev, "can not allocate tx dma channel\n");
+ ret = -ENODEV;
goto free_rx_dma;
}
@@ -678,8 +680,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL);
sspi->dummypage = kmalloc(2 * PAGE_SIZE, GFP_KERNEL);
- if (!sspi->dummypage)
+ if (!sspi->dummypage) {
+ ret = -ENOMEM;
goto free_clk;
+ }
ret = spi_bitbang_start(&sspi->bitbang);
if (ret)
OpenPOWER on IntegriCloud