Commit abbd0ef1 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Mark Brown

spi: spi-fsl-dspi: Reduce indentation in dspi_release_dma()

There is no point in surrounding an entire function block in an if
condition. Rather, exit early if the condition is false.
Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20190818180115.31114-7-olteanv@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 06d5dd29
...@@ -471,18 +471,19 @@ static void dspi_release_dma(struct fsl_dspi *dspi) ...@@ -471,18 +471,19 @@ static void dspi_release_dma(struct fsl_dspi *dspi)
struct fsl_dspi_dma *dma = dspi->dma; struct fsl_dspi_dma *dma = dspi->dma;
struct device *dev = &dspi->pdev->dev; struct device *dev = &dspi->pdev->dev;
if (dma) { if (!dma)
if (dma->chan_tx) { return;
dma_unmap_single(dev, dma->tx_dma_phys,
DSPI_DMA_BUFSIZE, DMA_TO_DEVICE);
dma_release_channel(dma->chan_tx);
}
if (dma->chan_rx) { if (dma->chan_tx) {
dma_unmap_single(dev, dma->rx_dma_phys, dma_unmap_single(dev, dma->tx_dma_phys,
DSPI_DMA_BUFSIZE, DMA_FROM_DEVICE); DSPI_DMA_BUFSIZE, DMA_TO_DEVICE);
dma_release_channel(dma->chan_rx); dma_release_channel(dma->chan_tx);
} }
if (dma->chan_rx) {
dma_unmap_single(dev, dma->rx_dma_phys,
DSPI_DMA_BUFSIZE, DMA_FROM_DEVICE);
dma_release_channel(dma->chan_rx);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment