From: Hartmut Knaack <knaack.h@gmx.de>
To: Linus Walleij <linus.walleij@linaro.org>,
Jonathan Cameron <jic23@kernel.org>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: event_monitor: report unsupported events
Date: Tue, 11 Aug 2015 20:46:26 +0200 [thread overview]
Message-ID: <55CA4302.8080609@gmx.de> (raw)
In-Reply-To: <1439296478-19567-1-git-send-email-linus.walleij@linaro.org>
Linus Walleij schrieb am 11.08.2015 um 14:34:
> This makes the event monitor bail out with a helpful error
> message if a device does not support events, as a related
> fix to iio core now makes it return -ENODEV properly.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
> ---
> tools/iio/iio_event_monitor.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
> index cd3fd41b481d..d51eb04202e9 100644
> --- a/tools/iio/iio_event_monitor.c
> +++ b/tools/iio/iio_event_monitor.c
> @@ -284,7 +284,11 @@ int main(int argc, char **argv)
> ret = ioctl(fd, IIO_GET_EVENT_FD_IOCTL, &event_fd);
> if (ret == -1 || event_fd == -1) {
> ret = -errno;
> - fprintf(stderr, "Failed to retrieve event fd\n");
> + if (ret == -ENODEV)
> + fprintf(stderr,
> + "This device does not support events\n");
> + else
> + fprintf(stderr, "Failed to retrieve event fd\n");
> if (close(fd) == -1)
> perror("Failed to close character device file");
>
>
next prev parent reply other threads:[~2015-08-11 18:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 12:34 [PATCH] iio: event_monitor: report unsupported events Linus Walleij
2015-08-11 18:46 ` Hartmut Knaack [this message]
2015-08-15 15:17 ` Jonathan Cameron
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=55CA4302.8080609@gmx.de \
--to=knaack.h@gmx.de \
--cc=jic23@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
/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).