mtd: spi-nor: cadence-quadspi: Don't initialize rx_dma_complete on failure
authorVignesh Raghavendra <vigneshr@ti.com>
Mon, 1 Jun 2020 07:04:39 +0000 (12:34 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 19 Jun 2020 13:26:49 +0000 (14:26 +0100)
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>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20200601070444.16923-4-vigneshr@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/mtd/spi-nor/controllers/cadence-quadspi.c

index 8a9e17f..379e22c 100644 (file)
@@ -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);
 }