[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200229161841.89144-3-oleksandr.suvorov@toradex.com>
Date: Sat, 29 Feb 2020 18:18:41 +0200
From: Oleksandr Suvorov <oleksandr.suvorov@...adex.com>
To: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Oleksandr Suvorov <oleksandr.suvorov@...adex.com>,
Oleksandr Suvorov <cryosay@...il.com>,
Marcel Ziswiler <marcel.ziswiler@...adex.com>,
Igor Opaniuk <igor.opaniuk@...adex.com>,
Philippe Schenker <philippe.schenker@...adex.com>,
Mark Brown <broonie@...nel.org>
Subject: [PATCH 2/2] spi: spidev: fix speed setting message
The message of max device speed setting is shown when
an error in spi_setup() occurs.
Instead, it should be shown when the setup call succeeds.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@...adex.com>
---
drivers/spi/spidev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index c97e853dbf5c..80dd1025b953 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;
--
2.24.1
Powered by blists - more mailing lists