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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user