Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Frank Li <Frank.Li@nxp.com>, Mark Brown <broonie@kernel.org>,
	kernel@pengutronix.de, linux-spi@vger.kernel.org,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH spi-next 1/3] spi: spi-fsl-lpspi: pass struct fsl_lpspi_data instead of struct spi_controller if possible
Date: Mon, 12 Oct 2026 14:29:16 -0500	[thread overview]
Message-ID: <as01DLlbGMOO0jxq@SMW015318> (raw)
In-Reply-To: <20261009-spi-fsl-lpspi-more-cleanups-v1-1-2d4549d5205e@pengutronix.de>

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@pengutronix.de>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  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
>
>

  reply	other threads:[~2026-10-12 19:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 10:16 [PATCH spi-next 0/3] spi: spi-fsl-lpspi: various cleanup and enhancement patches - part 2 Marc Kleine-Budde
2026-10-09 10:16 ` [PATCH spi-next 1/3] spi: spi-fsl-lpspi: pass struct fsl_lpspi_data instead of struct spi_controller if possible Marc Kleine-Budde
2026-10-12 19:29   ` Frank Li [this message]
2026-10-09 10:16 ` [PATCH spi-next 2/3] spi: spi-fsl-lpspi: fsl_lpspi_transfer_one(): directly return ret Marc Kleine-Budde
2026-10-12 19:30   ` Frank Li
2026-10-09 10:16 ` [PATCH spi-next 3/3] spi: spi-fsl-lpspi: cache content of Interrupt Enable Register (IER) Marc Kleine-Budde
2026-10-12 19:31   ` Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as01DLlbGMOO0jxq@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=broonie@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox