driver: spi: kbus: fix: add contextualization to max_speed_hz validation

Signed-off-by: Heinrich Toews <ht@twx-software.de>
This commit is contained in:
Heinrich Toews
2025-12-10 15:21:57 +01:00
parent c4d103b9d7
commit 908ec46e4c
+5 -3
View File
@@ -1310,9 +1310,11 @@ static int omap2_mcspi_setup(struct spi_device *spi)
struct omap2_mcspi_cs *cs = spi->controller_state;
#ifdef CONFIG_SPI_KBUS_OMAP_EXTENSION
if (spi->max_speed_hz < (OMAP2_MCSPI_MAX_FREQ >> 15) ||
spi->max_speed_hz > OMAP2_MCSPI_MAX_FREQ)
return -EINVAL;
if (spi->dev.driver == &kbus_driver.driver) {
if (spi->max_speed_hz < (OMAP2_MCSPI_MAX_FREQ >> 15) ||
spi->max_speed_hz > OMAP2_MCSPI_MAX_FREQ)
return -EINVAL;
}
#endif
if (!cs) {