[PATCH 1/1] spi: convert transfer delay to new spi_delay struct

bo at mboxify.com bo at mboxify.com
Mon Jun 30 01:38:40 PDT 2025


On 2025-06-30 16:08, Sascha Hauer wrote:
> Hi,
> 
> On Fri, Jun 27, 2025 at 08:28:11PM +0800, Bo Sun wrote:
>> Replace the deprecated delay_usecs field with the new spi_delay struct
>> in spi_transfer structure. Update spi_transfer_one_message to use
>> spi_delay_exec and the mc13xxx driver to use the new structure.
>> 
>> Signed-off-by: Bo Sun <bo at mboxify.com>
>> ---
>>  drivers/mfd/mc13xxx.c | 5 ++++-
>>  drivers/spi/spi.c     | 4 +---
>>  include/spi/spi.h     | 8 ++++----
>>  3 files changed, 9 insertions(+), 8 deletions(-)
>> 
>> diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
>> index 288bd407ff..393f163671 100644
>> --- a/drivers/mfd/mc13xxx.c
>> +++ b/drivers/mfd/mc13xxx.c
>> @@ -84,7 +84,10 @@ static int spi_rw(struct spi_device *spi, void * 
>> buf, size_t len)
>>  		.rx_buf = buf,
>>  		.len = len,
>>  		.cs_change = 0,
>> -		.delay_usecs = 0,
> 
> It's initialized to 0, so
> 
>              if (xfer->delay_usecs)
>                      udelay(xfer->delay_usecs);
> 
> will do just nothing.
> 
>> +		.delay = {
>> +			.value = 0,
>> +			.unit = SPI_DELAY_UNIT_USECS,
>> +		},
> 
> I just dropped this and adjusted the commit message accordingly.

Thanks, and sorry for the oversight.

Bo

> 
> Sascha



More information about the barebox mailing list