diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-03-02 10:20:51 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-03-02 14:45:36 +0100 |
commit | 13262fc26c1837c51a5131dbbdd67a2387f8bfc7 (patch) | |
tree | 1f627106ee832a32675dfce070588e3d4839a09d /drivers/spi/spi-zynqmp-gqspi.c | |
parent | spi: dt-bindings: mediatek: Set min size for 'mediatek,pad-select' (diff) | |
download | linux-13262fc26c1837c51a5131dbbdd67a2387f8bfc7.tar.xz linux-13262fc26c1837c51a5131dbbdd67a2387f8bfc7.zip |
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>
Diffstat (limited to 'drivers/spi/spi-zynqmp-gqspi.c')
-rw-r--r-- | drivers/spi/spi-zynqmp-gqspi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 328b6559bb19..2b5afae8ff7f 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -1172,7 +1172,10 @@ static int zynqmp_qspi_probe(struct platform_device *pdev) goto clk_dis_all; } - dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(44)); + if (ret) + goto clk_dis_all; + ctlr->bits_per_word_mask = SPI_BPW_MASK(8); ctlr->num_chipselect = GQSPI_DEFAULT_NUM_CS; ctlr->mem_ops = &zynqmp_qspi_mem_ops; |