[PATCH V2 08/12] spi/mxs: Fix race in setup method

Trent Piepho tpiepho at gmail.com
Tue Apr 2 22:12:58 EDT 2013


On Tue, Apr 2, 2013 at 4:31 PM, Marek Vasut <marex at denx.de> wrote:
>>  static int mxs_spi_setup(struct spi_device *dev)
>>  {
>> -     int err = 0;
>> -
>>       if (!dev->bits_per_word)
>>               dev->bits_per_word = 8;
>>
>>       if (dev->mode & ~(SPI_CPOL | SPI_CPHA))
>>               return -EINVAL;
>>
>> -     err = mxs_spi_setup_transfer(dev, NULL);
>> -     if (err) {
>> -             dev_err(&dev->dev,
>> -                     "Failed to setup transfer, error = %d\n", err);
>> -     }
>> +     if (dev->bits_per_word != 8)
>> +             return -EINVAL;
>
> What's this new addition doing here?

It's not new.  The only useful thing mxs_spi_setup_transfer() (which
is no longer called) did in this instance was make that check.

> btw. I was under the impression the MXS SSP block can handle other word-widths
> than 8 bit, no ?

In theory it can, however the driver only supports 8-bits and will
reject anything else.



More information about the linux-arm-kernel mailing list