diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-08-22 20:33:39 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-23 05:36:58 -0400 |
commit | 6cca9e2dd01adfa46a3b81f54f80d318714da418 (patch) | |
tree | e6a942217229c8edb4f37176f48043e4b735d546 /drivers/spi/spi-sirf.c | |
parent | 2479790b2970ee386174431af2ad9c948b328b95 (diff) |
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/spi-sirf.c')
-rw-r--r-- | drivers/spi/spi-sirf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 546fae2c107a..acfca880fe84 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) | |||
650 | (void *)rx_dma_ch); | 650 | (void *)rx_dma_ch); |
651 | if (!sspi->rx_chan) { | 651 | if (!sspi->rx_chan) { |
652 | dev_err(&pdev->dev, "can not allocate rx dma channel\n"); | 652 | dev_err(&pdev->dev, "can not allocate rx dma channel\n"); |
653 | ret = -ENODEV; | ||
653 | goto free_master; | 654 | goto free_master; |
654 | } | 655 | } |
655 | sspi->tx_chan = dma_request_channel(dma_cap_mask, (dma_filter_fn)sirfsoc_dma_filter_id, | 656 | sspi->tx_chan = dma_request_channel(dma_cap_mask, (dma_filter_fn)sirfsoc_dma_filter_id, |
656 | (void *)tx_dma_ch); | 657 | (void *)tx_dma_ch); |
657 | if (!sspi->tx_chan) { | 658 | if (!sspi->tx_chan) { |
658 | dev_err(&pdev->dev, "can not allocate tx dma channel\n"); | 659 | dev_err(&pdev->dev, "can not allocate tx dma channel\n"); |
660 | ret = -ENODEV; | ||
659 | goto free_rx_dma; | 661 | goto free_rx_dma; |
660 | } | 662 | } |
661 | 663 | ||
@@ -678,8 +680,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) | |||
678 | writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL); | 680 | writel(0, sspi->base + SIRFSOC_SPI_DUMMY_DELAY_CTL); |
679 | 681 | ||
680 | sspi->dummypage = kmalloc(2 * PAGE_SIZE, GFP_KERNEL); | 682 | sspi->dummypage = kmalloc(2 * PAGE_SIZE, GFP_KERNEL); |
681 | if (!sspi->dummypage) | 683 | if (!sspi->dummypage) { |
684 | ret = -ENOMEM; | ||
682 | goto free_clk; | 685 | goto free_clk; |
686 | } | ||
683 | 687 | ||
684 | ret = spi_bitbang_start(&sspi->bitbang); | 688 | ret = spi_bitbang_start(&sspi->bitbang); |
685 | if (ret) | 689 | if (ret) |