Re: [PATCH] spi: add spi_sync_single_transfer wrapper for single spi_transfer

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

 



Hi Lars,

> > The spi_sync_single_transfer function calls spi_sync_transfer
> > with a single spi_transfer element, instead of an array.
> 
> So, what's the advantage of using this as opposed to calling
> spi_sync_transfer with a 1 for the number of transfers?

Not much, but it keeps the code a bit nicer to read for those
using spi_sync_transfer with only one spi_transfer. Besides it's
also more understandable what the function itself does and there
would not be any need to jump into the spi_sync_transfer to check
what the number '1' is needed for (for example it's not a boolean 
'true' value).

I checked and there are quite many uses of spi_sync_transfer with
only 1 transfer.

Thanks,
Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux