[PATCH] dm: spi: Prevent setting a speed of 0 Hz in spi_post_probe

Michal Simek michal.simek at xilinx.com
Tue Mar 16 13:33:57 CET 2021


The commit 12bfb2e05fc2 ("dm: spi: prevent setting a speed of 0 Hz")
changes default value from 0 to SPI_DEFAULT_SPEED_HZ but spi_post_probe()
hasn't been updated in the same way. It should be also update to be aligned
with previous patch.

Fixes: 12bfb2e05fc2 ("dm: spi: prevent setting a speed of 0 Hz")
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 drivers/spi/spi-uclass.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index 7155d4aebd6d..dd2c82165684 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -178,7 +178,8 @@ static int spi_post_probe(struct udevice *bus)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
 	struct dm_spi_bus *spi = dev_get_uclass_priv(bus);
 
-	spi->max_hz = dev_read_u32_default(bus, "spi-max-frequency", 0);
+	spi->max_hz = dev_read_u32_default(bus, "spi-max-frequency",
+					   SPI_DEFAULT_SPEED_HZ);
 #endif
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 	struct dm_spi_ops *ops = spi_get_ops(bus);
-- 
2.30.1



More information about the U-Boot mailing list