Message ID | CAPgLHd-CMEbwqXXvEK7ybSYrDeJPQfkbi+LgRepke_U=WoKmkA@mail.gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On 12/13/2013 09:42 PM, Wei Yongjun wrote: > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> > > In case of error, the function dma_request_slave_channel() returns > NULL pointer not ERR_PTR(). The IS_ERR() test in the return value > diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c > dma_chan = dma_request_slave_channel(tspi->dev, > dma_to_memory ? "rx" : "tx"); > - if (IS_ERR(dma_chan)) { ... > + if (!dma_chan) { The code should be calling dma_request_slave_channel_or_reason() rather than dma_request_slave_channel(). Dan Williams provided a patch to fix this, which I've now applied. -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index 1e61e98..3643178 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -614,12 +614,9 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi, dma_chan = dma_request_slave_channel(tspi->dev, dma_to_memory ? "rx" : "tx"); - if (IS_ERR(dma_chan)) { - ret = PTR_ERR(dma_chan); - if (ret != -EPROBE_DEFER) - dev_err(tspi->dev, - "Dma channel is not available: %d\n", ret); - return ret; + if (!dma_chan) { + dev_err(tspi->dev, "Dma channel is not available: %d\n", ret); + return -ENODEV; } dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size,