Skip to content

Commit

Permalink
spi: tegra: checking for ERR_PTR instead of NULL
Browse files Browse the repository at this point in the history
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: a915d15 ('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>
  • Loading branch information
Dan Carpenter authored and Stephen Warren committed Dec 16, 2013
1 parent f1d6ff7 commit 8a0a1af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-tegra20-slink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a0a1af

Please sign in to comment.