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

spi: spi-zynqmp-gqspi: Handle error for dma_set_mask

As the potential failure of the dma_set_mask(),
it should be better to check it and return error
if fails.

Fixes: 126bdb606fd2 ("spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220302092051.121343-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jiasheng Jiang and committed by
Mark Brown
13262fc2 d149dd2a

+4 -1
+4 -1
drivers/spi/spi-zynqmp-gqspi.c
··· 1172 1172 goto clk_dis_all; 1173 1173 } 1174 1174 1175 - dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); 1175 + ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); 1176 + if (ret) 1177 + goto clk_dis_all; 1178 + 1176 1179 ctlr->bits_per_word_mask = SPI_BPW_MASK(8); 1177 1180 ctlr->num_chipselect = GQSPI_DEFAULT_NUM_CS; 1178 1181 ctlr->mem_ops = &zynqmp_qspi_mem_ops;