diff mbox series

[3/6] mtd: spi-nor: cadence-quadspi: Don't initialize rx_dma_complete on failure

Message ID 20200508185411.487-4-vigneshr@ti.com
State Accepted
Commit 48aae57f0f9f57797772bd462b4d64902b1b4ae1
Headers show
Series None | expand

Commit Message

Vignesh Raghavendra May 8, 2020, 6:54 p.m. UTC
If driver fails to acquire DMA channel then don't initialize
rx_dma_complete struct as it won't be used.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/mtd/spi-nor/controllers/cadence-quadspi.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/controllers/cadence-quadspi.c b/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
index 4d2e732b85b1..6feb94a38dff 100644
--- a/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
@@ -1173,6 +1173,7 @@  static void cqspi_request_mmap_dma(struct cqspi_st *cqspi)
 	if (IS_ERR(cqspi->rx_chan)) {
 		dev_err(&cqspi->pdev->dev, "No Rx DMA available\n");
 		cqspi->rx_chan = NULL;
+		return;
 	}
 	init_completion(&cqspi->rx_dma_complete);
 }