diff options
author | Vladimir Oltean <olteanv@gmail.com> | 2019-08-18 21:01:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-08-20 14:05:18 +0100 |
commit | abbd0ef1f2542621e0f94a7273b7f7e458a38497 (patch) | |
tree | 78fc5178ed39454d6e111d39356f73b00b762714 | |
parent | 06d5dd29976fb49f3236b1e66142680619ea259d (diff) |
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: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20190818180115.31114-7-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index b0c546841260..c07525a9fd34 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -471,18 +471,19 @@ static void dspi_release_dma(struct fsl_dspi *dspi) struct fsl_dspi_dma *dma = dspi->dma; struct device *dev = &dspi->pdev->dev; - if (dma) { - if (dma->chan_tx) { - dma_unmap_single(dev, dma->tx_dma_phys, - DSPI_DMA_BUFSIZE, DMA_TO_DEVICE); - dma_release_channel(dma->chan_tx); - } + if (!dma) + return; - if (dma->chan_rx) { - dma_unmap_single(dev, dma->rx_dma_phys, - DSPI_DMA_BUFSIZE, DMA_FROM_DEVICE); - dma_release_channel(dma->chan_rx); - } + if (dma->chan_tx) { + dma_unmap_single(dev, dma->tx_dma_phys, + DSPI_DMA_BUFSIZE, DMA_TO_DEVICE); + 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); } } |