Re: [PATCH] mfd: ocelot-spi: Use spi_sync_transfer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 04, 2024 at 09:25:09PM +0200, Christophe JAILLET wrote:
> Use spi_sync_transfer() instead of hand-writing it.
> It is less verbose.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
>  drivers/mfd/ocelot-spi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/ocelot-spi.c b/drivers/mfd/ocelot-spi.c
> index 94f82677675b..b015c8683f1b 100644
> --- a/drivers/mfd/ocelot-spi.c
> +++ b/drivers/mfd/ocelot-spi.c
> @@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
>  	struct device *dev = context;
>  	struct ocelot_ddata *ddata;
>  	struct spi_device *spi;
> -	struct spi_message msg;
>  	unsigned int index = 0;
>  
>  	ddata = dev_get_drvdata(dev);
> @@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
>  	xfers[index].len = val_size;
>  	index++;
>  
> -	spi_message_init_with_transfers(&msg, xfers, index);
> -
> -	return spi_sync(spi, &msg);
> +	return spi_sync_transfer(spi, xfers, index);
>  }
>  

Thanks! I am fighting an unrelated SPI regression, so I tested against 6.7

Reviewed-by: Colin Foster <colin.foster@xxxxxxxxxxxxxxxx>
Tested-by: Colin Foster <colin.foster@xxxxxxxxxxxxxxxx>





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux