mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 22:28:00 +00:00
spi: atmel: Use dma_request_chan() instead dma_request_slave_channel()
dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. By using dma_request_chan() directly the driver can support deferred probing against DMA. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20191212135550.4634-2-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
851c902fd2
commit
d947c9d26c
1 changed files with 11 additions and 18 deletions
|
@ -514,26 +514,19 @@ static int atmel_spi_configure_dma(struct spi_master *master,
|
||||||
master->dma_tx = dma_request_chan(dev, "tx");
|
master->dma_tx = dma_request_chan(dev, "tx");
|
||||||
if (IS_ERR(master->dma_tx)) {
|
if (IS_ERR(master->dma_tx)) {
|
||||||
err = PTR_ERR(master->dma_tx);
|
err = PTR_ERR(master->dma_tx);
|
||||||
if (err == -EPROBE_DEFER) {
|
if (err != -EPROBE_DEFER)
|
||||||
dev_warn(dev, "no DMA channel available at the moment\n");
|
dev_err(dev, "No TX DMA channel, DMA is disabled\n");
|
||||||
goto error_clear;
|
|
||||||
}
|
|
||||||
dev_err(dev,
|
|
||||||
"DMA TX channel not available, SPI unable to use DMA\n");
|
|
||||||
err = -EBUSY;
|
|
||||||
goto error_clear;
|
goto error_clear;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
master->dma_rx = dma_request_chan(dev, "rx");
|
||||||
* No reason to check EPROBE_DEFER here since we have already requested
|
if (IS_ERR(master->dma_rx)) {
|
||||||
* tx channel. If it fails here, it's for another reason.
|
err = PTR_ERR(master->dma_rx);
|
||||||
*/
|
/*
|
||||||
master->dma_rx = dma_request_slave_channel(dev, "rx");
|
* No reason to check EPROBE_DEFER here since we have already
|
||||||
|
* requested tx channel.
|
||||||
if (!master->dma_rx) {
|
*/
|
||||||
dev_err(dev,
|
dev_err(dev, "No RX DMA channel, DMA is disabled\n");
|
||||||
"DMA RX channel not available, SPI unable to use DMA\n");
|
|
||||||
err = -EBUSY;
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,7 +541,7 @@ static int atmel_spi_configure_dma(struct spi_master *master,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
if (master->dma_rx)
|
if (!IS_ERR(master->dma_rx))
|
||||||
dma_release_channel(master->dma_rx);
|
dma_release_channel(master->dma_rx);
|
||||||
if (!IS_ERR(master->dma_tx))
|
if (!IS_ERR(master->dma_tx))
|
||||||
dma_release_channel(master->dma_tx);
|
dma_release_channel(master->dma_tx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue