Skip to content

Commit

Permalink
spi: sirf: fix error return code in spi_sirfsoc_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Mark Brown committed Aug 23, 2013
1 parent 2479790 commit 6cca9e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/spi/spi-sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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)
Expand Down

0 comments on commit 6cca9e2

Please sign in to comment.