diff mbox series

mtd: rawnand: qcom: Use dma_mapping_error() for error check

Message ID 20210405050912.115591-1-manivannan.sadhasivam@linaro.org
State Accepted
Commit 32cbc7cb70b07041e82f897f96b3035358470b14
Headers show
Series mtd: rawnand: qcom: Use dma_mapping_error() for error check | expand

Commit Message

Manivannan Sadhasivam April 5, 2021, 5:09 a.m. UTC
dma_mapping_error() should be used for checking the error value of
dma_map_resource() API.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

---
 drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1

Comments

Miquel Raynal April 7, 2021, 9:06 a.m. UTC | #1
On Mon, 2021-04-05 at 05:09:12 UTC, Manivannan Sadhasivam wrote:
> dma_mapping_error() should be used for checking the error value of
> dma_map_resource() API.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index fe74cf3aece5..07b3c156a802 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2990,7 +2990,7 @@  static int qcom_nandc_probe(struct platform_device *pdev)
 	nandc->base_dma = dma_map_resource(dev, res->start,
 					   resource_size(res),
 					   DMA_BIDIRECTIONAL, 0);
-	if (!nandc->base_dma)
+	if (dma_mapping_error(dev, nandc->base_dma))
 		return -ENXIO;
 
 	ret = qcom_nandc_alloc(nandc);