Re: [PATCH spi-next 1/3] spi: spi-fsl-lpspi: pass struct fsl_lpspi_data instead of struct spi_controller if possible
From: Frank Li
Date: Mon Oct 12 2026 - 15:29:35 EST
On Fri, Oct 09, 2026 at 12:16:35PM +0200, Marc Kleine-Budde wrote:
> Instead of passing a spi_controller pointer to functions and using
> spi_controller_get_devdata() to get the struct fsl_lpspi_data pointer,
> directly pass a struct fsl_lpspi_data pointer.
>
> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> drivers/spi/spi-fsl-lpspi.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
> index 5aa0a75b4e57..a3c5bab1acc7 100644
> --- a/drivers/spi/spi-fsl-lpspi.c
> +++ b/drivers/spi/spi-fsl-lpspi.c
> @@ -550,11 +550,8 @@ static int fsl_lpspi_target_abort(struct spi_controller *controller)
> return 0;
> }
>
> -static int fsl_lpspi_wait_for_completion(struct spi_controller *controller)
> +static int fsl_lpspi_wait_for_completion(struct fsl_lpspi_data *fsl_lpspi)
> {
> - struct fsl_lpspi_data *fsl_lpspi =
> - spi_controller_get_devdata(controller);
> -
> if (fsl_lpspi->is_target) {
> if (wait_for_completion_interruptible(&fsl_lpspi->xfer_done) ||
> fsl_lpspi->target_aborted) {
> @@ -758,11 +755,9 @@ static int fsl_lpspi_dma_init(struct device *dev,
> return ret;
> }
>
> -static int fsl_lpspi_pio_transfer(struct spi_controller *controller,
> +static int fsl_lpspi_pio_transfer(struct fsl_lpspi_data *fsl_lpspi,
> struct spi_transfer *t)
> {
> - struct fsl_lpspi_data *fsl_lpspi =
> - spi_controller_get_devdata(controller);
> int ret;
>
> fsl_lpspi->tx_buf = t->tx_buf;
> @@ -774,7 +769,7 @@ static int fsl_lpspi_pio_transfer(struct spi_controller *controller,
>
> fsl_lpspi_write_tx_fifo(fsl_lpspi);
>
> - ret = fsl_lpspi_wait_for_completion(controller);
> + ret = fsl_lpspi_wait_for_completion(fsl_lpspi);
>
> fsl_lpspi_reset(fsl_lpspi);
>
> @@ -803,7 +798,7 @@ static int fsl_lpspi_transfer_one(struct spi_controller *controller,
> if (fsl_lpspi->usedma)
> ret = fsl_lpspi_dma_transfer(controller, fsl_lpspi, t);
> else
> - ret = fsl_lpspi_pio_transfer(controller, t);
> + ret = fsl_lpspi_pio_transfer(fsl_lpspi, t);
> if (ret < 0)
> return ret;
>
>
> --
> 2.53.0
>
>