summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-02-24 16:26:43 +0200
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-02-24 16:39:45 +0200
commitb8d3770e5ec38bdefba88750eed41d5bbe1b2f5f (patch)
tree7976879ed7fb0c495d4a253584155088c659c44d
parent49bdc5d1e28f7b058289afe4947ba04cc625d9ab (diff)
spi: spidev: fix a showing of speed setting message
The debug message of max device speed setting is shown when an error in spi_setup() occurs. It should be shown when the setup call is succeeded instead. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
-rw-r--r--drivers/spi/spidev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 922c795..125123b 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -454,10 +454,11 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
spi->max_speed_hz = tmp;
retval = spi_setup(spi);
- if (retval >= 0)
+ if (retval == 0) {
spidev->speed_hz = tmp;
- else
- dev_dbg(&spi->dev, "%d Hz (max)\n", tmp);
+ dev_dbg(&spi->dev, "%d Hz (max)\n",
+ spidev->speed_hz);
+ }
spi->max_speed_hz = save;
}
break;