spi: tegra: checking for ERR_PTR instead of NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 16 Dec 2013 14:02:10 +0000 (17:02 +0300)
committerStephen Warren <swarren@nvidia.com>
Mon, 16 Dec 2013 16:51:58 +0000 (09:51 -0700)
dma_request_slave_channel() returns NULL on error and not ERR_PTRs.
I've fixed this by using dma_request_slave_channel_reason() which does
return ERR_PTRs.

Fixes: a915d150f68d ('spi: tegra: convert to standard DMA DT bindings')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
drivers/spi/spi-tegra20-slink.c

index dd6f26c059479662fa4ad85e3044465c185b5d72..a728bb82090fa5a956b68eca4f5c613c346a2a5f 100644 (file)
@@ -630,8 +630,8 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi,
        int ret;
        struct dma_slave_config dma_sconfig;
 
-       dma_chan = dma_request_slave_channel(tspi->dev,
-                                            dma_to_memory ? "rx" : "tx");
+       dma_chan = dma_request_slave_channel_reason(tspi->dev,
+                                               dma_to_memory ? "rx" : "tx");
        if (IS_ERR(dma_chan)) {
                ret = PTR_ERR(dma_chan);
                if (ret != -EPROBE_DEFER)