Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: tegra210-quad: Don't initialise DMA if not supported

The following error messages are observed on boot for Tegra234 ...

ERR KERN tegra-qspi 3270000.spi: cannot use DMA: -19
ERR KERN tegra-qspi 3270000.spi: falling back to PIO

Tegra234 does not support DMA for the QSPI and so initialising the DMA
is expected to fail. The above error messages are misleading for devices
that don't support DMA and so fix this by skipping the DMA
initialisation for devices that don't support DMA.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20221026155633.141792-1-jonathanh@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jon Hunter and committed by
Mark Brown
ae4b3c12 c1de355e

+6
+6
drivers/spi/spi-tegra210-quad.c
··· 720 720 721 721 static void tegra_qspi_deinit_dma(struct tegra_qspi *tqspi) 722 722 { 723 + if (!tqspi->soc_data->has_dma) 724 + return; 725 + 723 726 if (tqspi->tx_dma_buf) { 724 727 dma_free_coherent(tqspi->dev, tqspi->dma_buf_size, 725 728 tqspi->tx_dma_buf, tqspi->tx_dma_phys); ··· 752 749 dma_addr_t dma_phys; 753 750 u32 *dma_buf; 754 751 int err; 752 + 753 + if (!tqspi->soc_data->has_dma) 754 + return 0; 755 755 756 756 dma_chan = dma_request_chan(tqspi->dev, "rx"); 757 757 if (IS_ERR(dma_chan)) {