Skip to content
Commit 12bfb2e0 authored by Simon Goldschmidt's avatar Simon Goldschmidt Committed by Simon Glass
Browse files

dm: spi: prevent setting a speed of 0 Hz



When the device tree is missing a correct spi slave description below
the bus (compatible "spi-flash" or spi-max-frequency are missing),
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 (same
fallback value as is done in 'dm_spi_claim_bus') and issue a warning
to console.

Signed-off-by: default avatarSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent b2364485
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment