mirror of
https://github.com/torvalds/linux.git
synced 2026-11-30 18:42:21 +00:00
spi: Limit the spi device max speed to controller's max speed
Make sure the max_speed_hz of spi_device does not override the max_speed_hz of controller. Signed-off-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
+2
-1
@@ -3369,7 +3369,8 @@ int spi_setup(struct spi_device *spi)
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (!spi->max_speed_hz)
|
||||
if (!spi->max_speed_hz ||
|
||||
spi->max_speed_hz > spi->controller->max_speed_hz)
|
||||
spi->max_speed_hz = spi->controller->max_speed_hz;
|
||||
|
||||
mutex_lock(&spi->controller->io_mutex);
|
||||
|
||||
Reference in New Issue
Block a user