diff options
| author | Marc Kleine-Budde <mkl@pengutronix.de> | 2026-03-19 19:55:42 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-04-07 13:54:30 +0300 |
| commit | e59fe5e0c418da4cf0432faa0fc9062d56bd98b1 (patch) | |
| tree | 3402bcc5ecabb613d63116583fa19679c66b0eae | |
| parent | ca431d50bf62cca8f0a502e76b3d75ee371af32c (diff) | |
| download | linux-e59fe5e0c418da4cf0432faa0fc9062d56bd98b1.tar.xz | |
spi: spi-fsl-lpspi: fsl_lpspi_can_dma(): directly assign return value to fsl_lpspi->usedma
The function fsl_lpspi_can_dma() returns a bool.
Simplify the code, remove the if/else and assign the return value of
fsl_lpspi_can_dma() directly to fsl_lpspi->usedma.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20260319-spi-fsl-lpspi-cleanups-v2-8-02b56c5d44a8@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi-fsl-lpspi.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 904195f7b050..577403026c68 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -519,10 +519,7 @@ static int fsl_lpspi_prepare_message(struct spi_controller *controller, fsl_lpspi->usedma = false; ret = fsl_lpspi_setup_transfer(controller, spi, t); - if (fsl_lpspi_can_dma(controller, spi, t)) - fsl_lpspi->usedma = true; - else - fsl_lpspi->usedma = false; + fsl_lpspi->usedma = fsl_lpspi_can_dma(controller, spi, t); if (ret < 0) return ret; @@ -796,10 +793,7 @@ static int fsl_lpspi_transfer_one(struct spi_controller *controller, spi_controller_get_devdata(controller); int ret; - if (fsl_lpspi_can_dma(controller, spi, t)) - fsl_lpspi->usedma = true; - else - fsl_lpspi->usedma = false; + fsl_lpspi->usedma = fsl_lpspi_can_dma(controller, spi, t); ret = fsl_lpspi_setup_transfer(controller, spi, t); if (ret < 0) |
