diff mbox series

spi: Remove one needless transfer speed fall back case

Message ID 20190412132551.2167-1-jarkko.nikula@linux.intel.com (mailing list archive)
State Accepted
Commit 76d2f7ee68b669c5825435bad204f3d9b4b55d18
Headers show
Series spi: Remove one needless transfer speed fall back case | expand

Commit Message

Jarkko Nikula April 12, 2019, 1:25 p.m. UTC
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>
---
 drivers/spi/spi.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index bf4027b54a19..86a31340ad03 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -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;