linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Suvorov <oleksandr.suvorov-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>
To: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Oleksandr Suvorov
	<oleksandr.suvorov-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>,
	Oleksandr Suvorov
	<cryosay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Marcel Ziswiler
	<marcel.ziswiler-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>,
	Igor Opaniuk
	<igor.opaniuk-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>,
	Philippe Schenker
	<philippe.schenker-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: [PATCH 2/2] spi: spidev: fix speed setting message
Date: Sat, 29 Feb 2020 18:18:41 +0200	[thread overview]
Message-ID: <20200229161841.89144-3-oleksandr.suvorov@toradex.com> (raw)
In-Reply-To: <20200229161841.89144-1-oleksandr.suvorov-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>

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-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>
---

 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

  parent reply	other threads:[~2020-02-29 16:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-29 16:18 [PATCH 0/2] spi: spidev: Fix messages in spidev Oleksandr Suvorov
     [not found] ` <20200229161841.89144-1-oleksandr.suvorov-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>
2020-02-29 16:18   ` [PATCH 1/2] spi: spidev: fix a debug message value Oleksandr Suvorov
2020-03-02 16:05     ` Applied "spi: spidev: fix a debug message value" to the spi tree Mark Brown
2020-02-29 16:18   ` Oleksandr Suvorov [this message]
     [not found]     ` <20200229161841.89144-3-oleksandr.suvorov-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org>
2020-03-02 16:05       ` Applied "spi: spidev: fix speed setting message" " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200229161841.89144-3-oleksandr.suvorov@toradex.com \
    --to=oleksandr.suvorov-2kbjvhiyjgbbdgjk7y7tuq@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=cryosay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=igor.opaniuk-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marcel.ziswiler-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org \
    --cc=philippe.schenker-2KBjVHiyJgBBDgjK7y7TUQ@public.gmane.org \
    --subject='Re: [PATCH 2/2] spi: spidev: fix speed setting message' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).