Skip to content

Commit

Permalink
spi: spi-ti-qspi: Fix error handling
Browse files Browse the repository at this point in the history
'dma_request_chan_by_mask()' can not return NULL.
Try to keep the logic in 'no_dma:' by resetting 'qspi->rx_chan' in case
of error.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Mark Brown committed Feb 19, 2017
1 parent 582c97f commit 30fb272
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/spi-ti-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,10 @@ static int ti_qspi_probe(struct platform_device *pdev)
dma_cap_set(DMA_MEMCPY, mask);

qspi->rx_chan = dma_request_chan_by_mask(&mask);
if (!qspi->rx_chan) {
if (IS_ERR(qspi->rx_chan)) {
dev_err(qspi->dev,
"No Rx DMA available, trying mmap mode\n");
qspi->rx_chan = NULL;
ret = 0;
goto no_dma;
}
Expand Down

0 comments on commit 30fb272

Please sign in to comment.