Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2111316ybf; Mon, 2 Mar 2020 02:09:02 -0800 (PST) X-Google-Smtp-Source: ADFU+vtF3jgLl0By7YnopVUQspvhVd2NszKPMim3vKPIAlBT53itDNVQaxbvcrkHu9TBZ4w798MA X-Received: by 2002:aca:c341:: with SMTP id t62mr2749087oif.41.1583143742610; Mon, 02 Mar 2020 02:09:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583143742; cv=none; d=google.com; s=arc-20160816; b=aCNAgBgySH5PRJfPrK42rfnunaN+jSLFMrcnSsIE/0vNzHHaEICxSIAGKWIU2O5TZq q1h54dsl7sXW4ik/7cFByGZy41VKgvD18B9sBGR2n5+iTj/cqNcCjsayGQxGsR5HevAp LnzWZWHgRtT2RXbThvWmz8iePWvGB5za+Rf5nFBFtyC0DmD5FmWCvAlvUYUszhyGxYY6 g6xCDPT+Oi6WdbSc5GcSFC3PwO5oP3ZXYRsjhMeKsaBQfFFJj+6+sRCoXuYG+ROUj+77 rNpxiAO6dxe5Q0k5PQOI4j3Pf89TBp42nHVDqxPSRkYeLC9KlYAn0aDnT6Gnp0tgvYHX tPwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=LdBvzwKgjVpjvTg3I86sWpVRpCz5497rFM7qiRdKTjU=; b=OpNZ6l4nOYgnZldxLu1Y0JLAedD8IdbNM29+QWSECNc9J8p5CE2h3ZRPAb7WKZ6MB8 GiIvyf0P1qCyGWYYEHVu2IewOOZDww5curdIRpL4vUUy2v+1/f8XhyorN3lJzBQZImTF M40y0MF1weIaOO0DOu5sDJAnRPS7PcVEp9F2CWUpcJCgfVHrz9rWUtTozr42o+nzBSqm 2psRR1a/V0BnNBiM0qcK0SpxGvdtTb1l6/KNVQGQucTQ61AqOCRwTM/aCQ4dSV/1Rym2 XklYtG7uK2j82kq6T2VrD+jct8YAnuL5s/xQ44zv+VOcHHNiLubL2aq0UjlWfj7b6PNo a/LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16si5491192oic.23.2020.03.02.02.08.51; Mon, 02 Mar 2020 02:09:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727577AbgCBKIT (ORCPT + 99 others); Mon, 2 Mar 2020 05:08:19 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43206 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726887AbgCBKIS (ORCPT ); Mon, 2 Mar 2020 05:08:18 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id CE511292A3E Subject: Re: [PATCH 2/8] Input: cros_ec_keyb: Use cros_ec_cmd_xfer_status helper From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Cc: Collabora Kernel ML , groeck@chromium.org, bleung@chromium.org, dtor@chromium.org, gwendal@chromium.org, pmalani@chromium.org, Jonathan Cameron , Ting Shen , Neil Armstrong , Dmitry Torokhov , Fei Shao , linux-input@vger.kernel.org References: <20200220155859.906647-1-enric.balletbo@collabora.com> <20200220155859.906647-3-enric.balletbo@collabora.com> Message-ID: Date: Mon, 2 Mar 2020 11:08:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200220155859.906647-3-enric.balletbo@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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, >