Re: [PATCH 2/4] spi: orion: Respect per-transfer bits_per_word settings

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

 



On Thu, 2018-02-15 at 15:19 +0100, Jan Kundrát wrote:
> It's a bug to look at the device's bits_per_word because each transfer
> can override these settings. In fact, e.g., spidev cannot specify
> "global" bits_per_word and instead relies on passing that through every
> ioctl.
> 
> @@ -427,7 +427,7 @@ orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
>  	struct orion_spi *orion_spi;
>  	int cs = spi->chip_select;
>  
> -	word_len = spi->bits_per_word;
> +	word_len = xfer->bits_per_word ? xfer->bits_per_word : spi->bits_per_word;
>  	count = xfer->len;

__spi_validate() already does this.  You can just look at xfer-
>bits_per_word and it will have already been set  to spi->bits_per_word 
if necessary.  This should hold for all the xfer fields.  They are
validated and will incorporate the spi slave's and/or spi master's
default values as necessary.


��.n��������+%������w��{.n�����{����)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[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