]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: spi-fsl-lpspi: fsl_lpspi_can_dma(): directly assign return value to fsl_lpspi...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 Mar 2026 16:55:42 +0000 (17:55 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 7 Apr 2026 10:54:30 +0000 (11:54 +0100)
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>
drivers/spi/spi-fsl-lpspi.c

index 904195f7b050989d577b37ea42bed6fdc343381e..577403026c68eee32abe7a6af9e202057cae72f8 100644 (file)
@@ -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)