On Wed, Jun 26, 2013 at 06:54:46PM -0400, Scott Jiang wrote:

> +     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.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Uclinux-dist-devel mailing list
Uclinux-dist-devel@blackfin.uclinux.org
https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel

Reply via email to