linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>
Subject: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check
Date: Wed, 28 Apr 2021 16:08:15 +0100	[thread overview]
Message-ID: <20210428150815.136150-1-paul@crapouillou.net> (raw)

The ioctrl() call will return errno=EINVAL if the device does not
support the events interface, and not ENODEV.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 tools/iio/iio_event_monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
index bb03859db89d..cdd9a84f18fa 100644
--- a/tools/iio/iio_event_monitor.c
+++ b/tools/iio/iio_event_monitor.c
@@ -323,7 +323,7 @@ int main(int argc, char **argv)
 	ret = ioctl(fd, IIO_GET_EVENT_FD_IOCTL, &event_fd);
 	if (ret == -1 || event_fd == -1) {
 		ret = -errno;
-		if (ret == -ENODEV)
+		if (ret == -EINVAL)
 			fprintf(stderr,
 				"This device does not support events\n");
 		else
-- 
2.30.2


             reply	other threads:[~2021-04-28 15:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 15:08 Paul Cercueil [this message]
2021-04-28 15:30 ` [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check Sa, Nuno
2021-04-28 15:33   ` Sa, Nuno
2021-05-03 11:06     ` Jonathan Cameron
2021-05-03 11:07       ` Jonathan Cameron
2021-05-03 13:56       ` Linus Walleij
2021-05-03 14:35         ` Alexandru Ardelean

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=20210428150815.136150-1-paul@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).