From: Lee Jones <lee.jones@linaro.org>
To: Brian Norris <briannorris@chromium.org>
Cc: Benson Leung <bleung@chromium.org>,
linux-kernel@vger.kernel.org, Olof Johansson <olof@lixom.net>,
Shawn Nematbakhsh <shawnn@chromium.org>,
Alexandru Stan <amstan@chromium.org>,
Gwendal Grignou <gwendal@chromium.org>,
Enrico Granata <egranata@chromium.org>,
RaviChandra Sadineni <ravisadineni@chromium.org>
Subject: Re: [PATCH v2 1/2] platform/chrome: straighten out cros_ec_get_{next,host}_event() error codes
Date: Tue, 13 Nov 2018 07:57:14 +0000 [thread overview]
Message-ID: <20181113075714.GF29388@dell> (raw)
In-Reply-To: <20181108024939.174321-1-briannorris@chromium.org>
On Wed, 07 Nov 2018, Brian Norris wrote:
> cros_ec_get_next_event() is documented to return 0 for success and
> negative for errors. It currently returns negative for some errors, and
> non-negative (number of bytes received) for success (including some "no
> data available" responses as zero). This mostly works out OK, because the
> callers were more or less ignoring the documentation, and only treating
> positive values as success (and indepdently checking the modification of
> 'wakeup').
>
> Let's button this up by avoiding pretending to handle event/wakeup
> distinctions when no event info was retrieved (i.e., returned 0 bytes).
> And fix the documentation of cros_ec_get_host_event() and
> cros_ec_get_next_event() to accurately describe their behavior.
>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> v1 -> v2:
> * don't make as many changes to the API -- just fix the documentation
> and a few corner cases instead
> ---
> drivers/platform/chrome/cros_ec_proto.c | 4 ++--
> include/linux/mfd/cros_ec.h | 6 ++++--
> 2 files changed, 6 insertions(+), 4 deletions(-)
Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2018-11-13 7:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 2:49 Brian Norris
2018-11-08 2:49 ` [PATCH v2 2/2] platform/chrome: don't report EC_MKBP_EVENT_SENSOR_FIFO as wakeup Brian Norris
2018-11-14 5:34 ` Benson Leung
2018-11-13 7:57 ` Lee Jones [this message]
2018-11-14 5:33 ` [PATCH v2 1/2] platform/chrome: straighten out cros_ec_get_{next,host}_event() error codes Benson Leung
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=20181113075714.GF29388@dell \
--to=lee.jones@linaro.org \
--cc=amstan@chromium.org \
--cc=bleung@chromium.org \
--cc=briannorris@chromium.org \
--cc=egranata@chromium.org \
--cc=gwendal@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=ravisadineni@chromium.org \
--cc=shawnn@chromium.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
Powered by JetHome