mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 09:06:34 +07:00
spi: sprd: Release DMA channel also on probe deferral
If dma_request_chan() for TX channel fails with EPROBE_DEFER, the RX
channel would not be released and on next re-probe it would be requested
second time.
Fixes: 386119bc7b
("spi: sprd: spi: sprd: Add DMA mode support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20200901152713.18629-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2abaad6785
commit
687a2e7618
@ -563,11 +563,11 @@ static int sprd_spi_dma_request(struct sprd_spi *ss)
|
||||
|
||||
ss->dma.dma_chan[SPRD_SPI_TX] = dma_request_chan(ss->dev, "tx_chn");
|
||||
if (IS_ERR_OR_NULL(ss->dma.dma_chan[SPRD_SPI_TX])) {
|
||||
dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
|
||||
if (PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]) == -EPROBE_DEFER)
|
||||
return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
|
||||
|
||||
dev_err(ss->dev, "request TX DMA channel failed!\n");
|
||||
dma_release_channel(ss->dma.dma_chan[SPRD_SPI_RX]);
|
||||
return PTR_ERR(ss->dma.dma_chan[SPRD_SPI_TX]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user