>> + if (spi->master->bits_per_word_mask) {
>> + /* Only 32 bits fit in the mask */
>> + if (spi->bits_per_word > 32)
>> + return -EINVAL;
>> + if (!(spi->master->bits_per_word_mask &
>> + BIT(spi->bits_per_word - 1)))
>> + return -EINVAL;
>> + }
>
> Thinking about this a bit it might reject a valid transfer - it only
> checks the setting in the SPI device, not the setting in the transfer.
> This means that if the transfer overrides an unsuitable setting in the
> controller then an error will be generated as the fixed setting won't be
> seen. It's hard to imagine when that would happen without something
> being very confused but still feels better to check the bits per word
> from the first transfer too.
But the API description said that this call would fail if the protocol
driver specifies an option
that the underlying controller or its driver does not support. It's
strange if I request 9 bits per
word in setup successfully while calling it in transfer fail.
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general