diff mbox series

dmaengine: dw-edma: Fix error handling in dw_edma_pcied_probe()

Message ID 20211203061115.19458-1-zheyuma97@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series dmaengine: dw-edma: Fix error handling in dw_edma_pcied_probe() | expand

Commit Message

Zheyu Ma Dec. 3, 2021, 6:11 a.m. UTC
When err is a non-zero value, it means failure.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/dma/dw-edma/dw-edma-pcie.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
index 198f6cd8ac1b..92c4f5b7d229 100644
--- a/drivers/dma/dw-edma/dw-edma-pcie.c
+++ b/drivers/dma/dw-edma/dw-edma-pcie.c
@@ -187,12 +187,10 @@  static int dw_edma_pcie_probe(struct pci_dev *pdev,
 
 	/* DMA configuration */
 	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
-	if (!err) {
+	if (err) {
 		pci_err(pdev, "DMA mask 64 set failed\n");
 		return err;
 	} else {
-		pci_err(pdev, "DMA mask 64 set failed\n");
-
 		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
 		if (err) {
 			pci_err(pdev, "DMA mask 32 set failed\n");