
22 Jan
2018
22 Jan
'18
1:29 a.m.
Hi Simon,
On 18 January 2018 at 01:15, Simon Goldschmidt sgoldschmidt@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'.
Signed-off-by: Simon Goldschmidt sgoldschmidt@de.pepperl-fuchs.com
drivers/spi/spi-uclass.c | 2 ++ 1 file changed, 2 insertions(+)
Another option is to have a sensible default when reading from the DT fails. See spi_slave_ofdata_to_platdata() - you can add the default there.
Would that work?
Regards, Simon