diff mbox series

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

Message ID 20200526093604.11846-4-vigneshr@ti.com (mailing list archive)
State Superseded
Headers show
Series mtd: spi-nor: Move cadence-qaudspi to spi-mem framework | expand

Commit Message

Vignesh Raghavendra May 26, 2020, 9:36 a.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(+)

Comments

Tudor Ambarus May 28, 2020, 6:42 p.m. UTC | #1
On Tuesday, May 26, 2020 12:36:01 PM EEST Vignesh Raghavendra wrote:
> 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(+)

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
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 8a9e17f79d8d..379e22c11c87 100644
--- a/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
+++ b/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
@@ -1180,6 +1180,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);
 }