mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check
@ 2021-04-28 15:08 Paul Cercueil
  2021-04-28 15:30 ` Sa, Nuno
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Cercueil @ 2021-04-28 15:08 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald-Stadler
  Cc: linux-iio, linux-kernel, Paul Cercueil

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-03 14:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 15:08 [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check Paul Cercueil
2021-04-28 15:30 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®