[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR03MB3112198E9789BF3D95959E6F99409@CY4PR03MB3112.namprd03.prod.outlook.com>
Date: Wed, 28 Apr 2021 15:30:43 +0000
From: "Sa, Nuno" <Nuno.Sa@...log.com>
To: Paul Cercueil <paul@...pouillou.net>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>
CC: "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check
> From: Paul Cercueil <paul@...pouillou.net>
> Sent: Wednesday, April 28, 2021 5:08 PM
> To: Jonathan Cameron <jic23@...nel.org>; Lars-Peter Clausen
> <lars@...afoo.de>; Peter Meerwald-Stadler
> <pmeerw@...erw.net>
> Cc: linux-iio@...r.kernel.org; linux-kernel@...r.kernel.org; Paul
> Cercueil <paul@...pouillou.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@...pouillou.net>
Reviewed-by: Nuno Sa <nuno.sa@...log.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
Powered by blists - more mailing lists