[U-Boot] [PATCH] dm: spi: prevent setting a speed of 0 Hz

Simon Goldschmidt sgoldschmidt at de.pepperl-fuchs.com
Mon Jan 22 13:21:25 UTC 2018


On 22.01.2018 07:01, Jagan Teki wrote:
> On Thu, Jan 18, 2018 at 1:45 PM, Simon Goldschmidt
> <sgoldschmidt at de.pepperl-fuchs.com> wrote:
>> When the device tree is missing a correct spi slave description below
>> the bus, the 'set_speed' callback can be called with 'speed' == 0 Hz.
>> At least with cadence qspi, this leads to a division by zero.
>>
>> Prevent this by initializing speed to 100 kHz in this case, as is
>> done in 'dm_spi_claim_bus'.
> Better go-with default baudrate if speed == 0 this what usually does
> in remaining drivers.

That's what I did. I set a default value of 100 kHz. The difference 
seems to me that the remaining drivers are host drivers whereas I was 
trying to fix an invalid declaration of a df chip.

Regards,
Simon


More information about the U-Boot mailing list