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_setup_transfer(): remove useless spi_transfer NULL pointer check

fsl_lpspi_setup_transfer() is either called via:

| fsl_lpspi_prepare_message()
| -> fsl_lpspi_setup_transfer()

or

| -> spi_transfer_one_message()
| -> controller->transfer_one == fsl_lpspi_transfer_one()
| -> fsl_lpspi_setup_transfer()

The first call path already has a spi_transfer NULL pointer check, the
second one explicitly iterates over all spi_transfer of the spi_message.

Simplify the code by removing the useless NULL pointer check.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://patch.msgid.link/20260319-spi-fsl-lpspi-cleanups-v2-7-02b56c5d44a8@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Marc Kleine-Budde and committed by
Mark Brown
ca431d50 c6e17846

-3
-3
drivers/spi/spi-fsl-lpspi.c
··· 471 471 struct fsl_lpspi_data *fsl_lpspi = 472 472 spi_controller_get_devdata(spi->controller); 473 473 474 - if (t == NULL) 475 - return -EINVAL; 476 - 477 474 fsl_lpspi->config.mode = spi->mode; 478 475 fsl_lpspi->config.bpw = t->bits_per_word; 479 476 fsl_lpspi->config.speed_hz = t->speed_hz;