Skip to contentSkip to conversation

spi: tegra: checking for ERR_PTR instead of NULL

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 16, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: tegra: checking for ERR_PTR instead of NULL

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')
drivers/spi/spi-tegra20-slink.c +2 -2
index 1e61e9854064..be3a069879c3 100644
@@ -612,8 +612,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)
#1 lore raw
Quoted 6 lines · Dan Carpenter

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')

Oops. I validate there aren't any more issues like this, at least in the commits in the series this fixes.

I've applied this to Tegra's for-3.14/dmas-resets-rework branch, since that's the only place where the commit this fixes exists.