From: Marc Kleine-Budde Date: Thu, 19 Mar 2026 16:55:41 +0000 (+0100) Subject: spi: spi-fsl-lpspi: fsl_lpspi_setup_transfer(): remove useless spi_transfer NULL... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca431d50bf62cca8f0a502e76b3d75ee371af32c;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/20260319-spi-fsl-lpspi-cleanups-v2-7-02b56c5d44a8@pengutronix.de Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 25e657227013..904195f7b050 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -471,9 +471,6 @@ static int fsl_lpspi_setup_transfer(struct spi_controller *controller, struct fsl_lpspi_data *fsl_lpspi = spi_controller_get_devdata(spi->controller); - if (t == NULL) - return -EINVAL; - fsl_lpspi->config.mode = spi->mode; fsl_lpspi->config.bpw = t->bits_per_word; fsl_lpspi->config.speed_hz = t->speed_hz;