Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Marc Kleine-Budde and committed by
Mark Brown
e59fe5e0 ca431d50

+2 -8
+2 -8
drivers/spi/spi-fsl-lpspi.c
··· 519 519 fsl_lpspi->usedma = false; 520 520 ret = fsl_lpspi_setup_transfer(controller, spi, t); 521 521 522 - if (fsl_lpspi_can_dma(controller, spi, t)) 523 - fsl_lpspi->usedma = true; 524 - else 525 - fsl_lpspi->usedma = false; 522 + fsl_lpspi->usedma = fsl_lpspi_can_dma(controller, spi, t); 526 523 527 524 if (ret < 0) 528 525 return ret; ··· 793 796 spi_controller_get_devdata(controller); 794 797 int ret; 795 798 796 - if (fsl_lpspi_can_dma(controller, spi, t)) 797 - fsl_lpspi->usedma = true; 798 - else 799 - fsl_lpspi->usedma = false; 799 + fsl_lpspi->usedma = fsl_lpspi_can_dma(controller, spi, t); 800 800 801 801 ret = fsl_lpspi_setup_transfer(controller, spi, t); 802 802 if (ret < 0)