mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: Collabora Kernel ML <kernel@collabora.com>,
	groeck@chromium.org, bleung@chromium.org, dtor@chromium.org,
	gwendal@chromium.org, pmalani@chromium.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Ting Shen <phoenixshen@chromium.org>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Fei Shao <fshao@chromium.org>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 2/8] Input: cros_ec_keyb: Use cros_ec_cmd_xfer_status helper
Date: Mon, 2 Mar 2020 11:08:13 +0100	[thread overview]
Message-ID: <a4beacb4-b309-9e72-b522-186c5c059718@collabora.com> (raw)
In-Reply-To: <20200220155859.906647-3-enric.balletbo@collabora.com>

Hi Dmitry,

Gentle ping, I'd like feedback from you on this series, and are you fine with
this change?

Thanks,
 Enric

On 20/2/20 16:58, Enric Balletbo i Serra wrote:
> This patch makes use of cros_ec_cmd_xfer_status() instead of
> cros_ec_cmd_xfer(). In this case there is no advantage of doing this
> apart from that we want to make cros_ec_cmd_xfer() a private function
> for the EC protocol and let people only use the
> cros_ec_cmd_xfer_status() to return Linux standard error codes.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
>  drivers/input/keyboard/cros_ec_keyb.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index 2b71c5a51f90..fc1793ca2f17 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -347,18 +347,14 @@ static int cros_ec_keyb_info(struct cros_ec_device *ec_dev,
>  	params->info_type = info_type;
>  	params->event_type = event_type;
>  
> -	ret = cros_ec_cmd_xfer(ec_dev, msg);
> -	if (ret < 0) {
> -		dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n",
> -			 (int)info_type, (int)event_type, ret);
> -	} else if (msg->result == EC_RES_INVALID_VERSION) {
> +	ret = cros_ec_cmd_xfer_status(ec_dev, msg);
> +	if (ret == -ENOTSUPP) {
>  		/* With older ECs we just return 0 for everything */
>  		memset(result, 0, result_size);
>  		ret = 0;
> -	} else if (msg->result != EC_RES_SUCCESS) {
> -		dev_warn(ec_dev->dev, "Error getting info %d/%d: %d\n",
> -			 (int)info_type, (int)event_type, msg->result);
> -		ret = -EPROTO;
> +	} else if (ret < 0) {
> +		dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n",
> +			 (int)info_type, (int)event_type, ret);
>  	} else if (ret != result_size) {
>  		dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n",
>  			 (int)info_type, (int)event_type,
> 

  reply	other threads:[~2020-03-02 10:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 15:58 [PATCH 0/8] Migrate all cros_ec_cmd_xfer() calls to cros_ec_cmd_xfer_status() Enric Balletbo i Serra
2020-02-20 15:58 ` [PATCH 1/8] platform/chrome: cros_ec_proto: Report command not supported Enric Balletbo i Serra
2020-02-20 15:58 ` [PATCH 2/8] Input: cros_ec_keyb: Use cros_ec_cmd_xfer_status helper Enric Balletbo i Serra
2020-03-02 10:08   ` Enric Balletbo i Serra [this message]
2020-02-20 15:58 ` [PATCH 3/8] platform/chrome: cros_ec_vbc: " Enric Balletbo i Serra
2020-02-20 15:58 ` [PATCH 4/8] platform/chrome: cros_ec_chardev: " Enric Balletbo i Serra
2020-02-25 19:55   ` Prashant Malani
2020-02-26 14:59     ` Enric Balletbo i Serra
2020-02-26 17:32       ` Prashant Malani
2020-02-20 15:58 ` [PATCH 5/8] platform/chrome: cros_ec_sysfs: " Enric Balletbo i Serra
2020-02-20 15:58 ` [PATCH 6/8] platform/chrome: cros_ec_lightbar: " Enric Balletbo i Serra
2020-02-20 15:58 ` [PATCH 7/8] platform/chrome: cros_ec: " Enric Balletbo i Serra
2020-02-20 15:58 ` [PATCH 8/8] platform/chrome: cros_ec_proto: Do not export cros_ec_cmd_xfer() Enric Balletbo i Serra
2020-02-26  1:12 ` [PATCH 0/8] Migrate all cros_ec_cmd_xfer() calls to cros_ec_cmd_xfer_status() Prashant Malani

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=a4beacb4-b309-9e72-b522-186c5c059718@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bleung@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@chromium.org \
    --cc=fshao@chromium.org \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=kernel@collabora.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=phoenixshen@chromium.org \
    --cc=pmalani@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

all inboxes | Powered by JetHome®