summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-02-21 12:36:25 +0200
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-02-24 16:39:45 +0200
commitc1d8dd6f172095f4c234c3f3f0989daf3c3b536d (patch)
tree384be33c1d4594b3931fe7bd8beab59cd49542e2
parent2a54e819e5a947267dd8df55f19912acff6c44d5 (diff)
Revert "spi: spidev: fix setting of max speed"
This is wrong approach to fix the speed issue. This reverts commit 6eb4142030916c2db5c3dd0a4301dbd1141593e2. Related-to: ELB-2387 Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
-rw-r--r--drivers/spi/spidev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 0eaa2a6..09584fc 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -454,12 +454,11 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
spi->max_speed_hz = tmp;
retval = spi_setup(spi);
- if (retval) {
- spi->max_speed_hz = save;
- } else {
+ if (retval >= 0)
spidev->speed_hz = tmp;
+ else
dev_dbg(&spi->dev, "%d Hz (max)\n", tmp);
- }
+ spi->max_speed_hz = save;
}
break;