Unverified Commit 894e04b7 authored by John Madieu's avatar John Madieu Committed by Mark Brown
Browse files

spi: imx: Propagate prepare_transfer() error from spi_imx_setupxfer()



spi_imx_setupxfer() calls the per-variant prepare_transfer()
callback and returns 0 unconditionally:

	spi_imx->devtype_data->prepare_transfer(spi_imx, spi, t);

	return 0;

mx51_ecspi_prepare_transfer() can return -EINVAL when the requested
word_delay does not fit in MX51_ECSPI_PERIOD_MASK. The error is
detected after a partial set of register writes (CTRL: BL, clkdiv,
SMC), so the controller is left in a partially-configured state and
the transfer is then submitted as if setup succeeded.

Propagate the return value. The other variants' prepare_transfer
callbacks all return 0, so this is a no-op for them.

Fixes: a3bb4e66 ("spi: imx: support word delay")
Signed-off-by: default avatarJohn Madieu <john.madieu@gmail.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260501135951.2416527-4-john.madieu@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f5b55482
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1382,9 +1382,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
		spi_imx->target_burst = t->len;
	}

	spi_imx->devtype_data->prepare_transfer(spi_imx, spi, t);

	return 0;
	return spi_imx->devtype_data->prepare_transfer(spi_imx, spi, t);
}

static void spi_imx_sdma_exit(struct spi_imx_data *spi_imx)