spi: Remove one needless transfer speed fall back case
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Fri, 12 Apr 2019 13:25:51 +0000 (16:25 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 2 May 2019 01:37:49 +0000 (10:37 +0900)
Falling back to maximum speed of the controller in case of SPI slave
maximum speed is not set is needless. It already defaults to maximum
speed of the controller since commit 052eb2d49006 ("spi: core: Set
max_speed_hz of spi_device default to max_speed_hz of controller").

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c

index bf4027b..86a3134 100644 (file)
@@ -3084,8 +3084,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
 
                if (!xfer->speed_hz)
                        xfer->speed_hz = spi->max_speed_hz;
-               if (!xfer->speed_hz)
-                       xfer->speed_hz = ctlr->max_speed_hz;
 
                if (ctlr->max_speed_hz && xfer->speed_hz > ctlr->max_speed_hz)
                        xfer->speed_hz = ctlr->max_speed_hz;