dm: spi: Prevent setting a speed of 0 Hz in spi_post_probe
PATCH 1/1 dm: spi: Prevent setting a speed of 0 Hz in spi_post_probe
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.
---
drivers/spi/spi-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-uclass.c +2 -1
@@ -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);
Signature · 1 line
2.30.1
PATCH 1/1 dm: spi: Prevent setting a speed of 0 Hz in spi_post_probe
Quoted 7 lines · Michal Simek
The commit
12bfb2e05fc2("dm: spi: prevent setting a speed of 0 Hz") changes default value from 0 toSPI_DEFAULT_SPEED_HZbutspi_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 <[email protected]>
Signature · 3 lines
Regards, Pratyush Yadav Texas Instruments Inc.
PATCH 1/1 dm: spi: Prevent setting a speed of 0 Hz in spi_post_probe
In reply to Michal SimekQuoted 8 lines · Michal Simek
The commit
12bfb2e05fc2("dm: spi: prevent setting a speed of 0 Hz") changes default value from 0 toSPI_DEFAULT_SPEED_HZbutspi_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 <[email protected]>Reviewed-by Pratyush Yadav <[email protected]>
This breaks tests:
=> ut dm spi_claim_bus
Test: dm_test_spi_claim_bus: spi.c
SF: Detected m25p16 with page size 256 Bytes, erase size 64 KiB, total 2 MiB
SF: Detected m25p16 with page size 256 Bytes, erase size 64 KiB, total 2 MiBtest/dm/spi.c:120, dm_test_spi_switch_slaves(): slave_a->max_hz == bus_data->speed: Expected 0x2625a00 (40000000), got 0x186a0 (100000) test/dm/spi.c:120, dm_test_spi_switch_slaves(): slave_a->max_hz == bus_data->speed: Expected 0x2625a00 (40000000), got 0x186a0 (100000) test/dm/spi.c:120, dm_test_spi_switch_slaves(): slave_a->max_hz == bus_data->speed: Expected 0x2faf080 (50000000), got 0x186a0 (100000)
Test: dm_test_spi_claim_bus: spi.c (flat tree)
SF: Detected m25p16 with page size 256 Bytes, erase size 64 KiB, total 2 MiB
SF: Detected m25p16 with page size 256 Bytes, erase size 64 KiB, total 2 MiBtest/dm/spi.c:120, dm_test_spi_switch_slaves(): slave_a->max_hz == bus_data->speed: Expected 0x2625a00 (40000000), got 0x186a0 (100000) test/dm/spi.c:120, dm_test_spi_switch_slaves(): slave_a->max_hz == bus_data->speed: Expected 0x2625a00 (40000000), got 0x186a0 (100000) test/dm/spi.c:120, dm_test_spi_switch_slaves(): slave_a->max_hz == bus_data->speed: Expected 0x2faf080 (50000000), got 0x186a0 (100000)
Failures: 6
So I assume a test needs updating too.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210317/df254d52/attachment.sig>