Files
linux-stable-mirror/drivers/spi
Devyn LiuandGreg Kroah-Hartman 8b28f8c5d1 spi: hisi-kunpeng: Add validation for the minimum value of speed_hz
[ Upstream commit c3c4f22b7c ]

The speed specified by the user is used to calculate the clk_div based
on the max_speed_hz in hisi_calc_effective_speed.  A very low speed
value can lead to a clk_div larger than the variable range. Avoid this
by setting the min_speed_hz so that such a small speed value is
rejected.  __spi_validate() in spi.c will return -EINVAL for the
specified speed_hz lower than min_speed_hz.

Signed-off-by: Devyn Liu <liudingyuan@huawei.com>
Reviewed-by: Jay Fang <f.fangjian@huawei.com>
Link: https://patch.msgid.link/20240730032040.3156393-2-liudingyuan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-08 07:54:31 +02:00
..
2023-08-07 21:59:25 +01:00
2023-08-07 14:38:33 +01:00
2023-08-21 14:29:26 +01:00
2023-08-21 14:29:37 +01:00
2023-09-19 13:17:52 +01:00
2024-07-25 09:50:47 +02:00