Re: [PATCH spi-next 2/3] spi: spi-fsl-lpspi: fsl_lpspi_transfer_one(): directly return ret

From: Frank Li

Date: Mon Oct 12 2026 - 15:30:50 EST


On Fri, Oct 09, 2026 at 12:16:36PM +0200, Marc Kleine-Budde wrote:

subject:

spi: spi-fsl-lpspi: directly return ret in fsl_lpspi_transfer_one().

Frank

> Both fsl_lpspi_dma_transfer() and fsl_lpspi_pio_transfer() only return
> negative error values in case of error or 0 in case of success.
>
> Directly return ret, there is no need to check for positive error values
> and return them as 0.
>
> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> ---
> drivers/spi/spi-fsl-lpspi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
> index a3c5bab1acc7..b25f94b2ef73 100644
> --- a/drivers/spi/spi-fsl-lpspi.c
> +++ b/drivers/spi/spi-fsl-lpspi.c
> @@ -799,10 +799,8 @@ static int fsl_lpspi_transfer_one(struct spi_controller *controller,
> ret = fsl_lpspi_dma_transfer(controller, fsl_lpspi, t);
> else
> ret = fsl_lpspi_pio_transfer(fsl_lpspi, t);
> - if (ret < 0)
> - return ret;
>
> - return 0;
> + return ret;
> }
>
> static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id)
>
> --
> 2.53.0
>
>