From: "Sa, Nuno" <Nuno.Sa@analog.com>
To: Paul Cercueil <paul@crapouillou.net>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check
Date: Wed, 28 Apr 2021 15:30:43 +0000 [thread overview]
Message-ID: <CY4PR03MB3112198E9789BF3D95959E6F99409@CY4PR03MB3112.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20210428150815.136150-1-paul@crapouillou.net>
> From: Paul Cercueil <paul@crapouillou.net>
> Sent: Wednesday, April 28, 2021 5:08 PM
> 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
>
>
> 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>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> ---
> 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
next prev parent reply other threads:[~2021-04-28 15:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 15:08 [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check Paul Cercueil
2021-04-28 15:30 ` Sa, Nuno [this message]
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=CY4PR03MB3112198E9789BF3D95959E6F99409@CY4PR03MB3112.namprd03.prod.outlook.com \
--to=nuno.sa@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@crapouillou.net \
--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).