From patchwork Mon Jul 25 18:14:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9246309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D38D60757 for ; Mon, 25 Jul 2016 18:14:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2455B26538 for ; Mon, 25 Jul 2016 18:14:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18E262705B; Mon, 25 Jul 2016 18:14:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 861CD26538 for ; Mon, 25 Jul 2016 18:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbcGYSO3 (ORCPT ); Mon, 25 Jul 2016 14:14:29 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:32844 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbcGYSO1 (ORCPT ); Mon, 25 Jul 2016 14:14:27 -0400 Received: by mail-pa0-f51.google.com with SMTP id ks6so63637368pab.0 for ; Mon, 25 Jul 2016 11:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5mWZFEd1uCItmlXAgyS0IaShB+wGs8o/MlQ/VJ4Ac/E=; b=AXUnO2f55E1PKlGuY3x+7Ta+4DMevV4k90z86syaaoVvpUB5WiK66HCDt0BRBpbKaJ as24yTRjXsHeep7PbFccDjLZcMYjTYViDY7CE0HxfORt9TMZXLGEtwplO5YivQysA/yT aU9yVS0iaU4uUzTLSi8XBLbrTVwKY6BO8eLEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5mWZFEd1uCItmlXAgyS0IaShB+wGs8o/MlQ/VJ4Ac/E=; b=EBw24LkHUiq9EkdxK+oDxLLYRgY03zuJ/7Lb1KWz7yyKEQzwMwtVrsjPPZajBvNnIG T9NPDEvkBeNkGibk327cnfg4vPKXDl+P9jks3b6gwcKozp1glbn1EUxisIwIVZm0npbh 0JDxfKT/ibKxZG19n9pIqaaYbKvbKTyL9xkwOIOc9tJ9nIfHRWNsmkT4jTl1Ap2PvSTi dkkUEh8wgFivTeWoxHQ/jM9UHGLyfLxOSgmsL5C7KNT2cVULkL6Gmw+PKc6iMLOI2osd BUKRhz0XQ63gRbofrtPIDOCbE7EEJFosl3+izfmBsUrUWB2fvvr8DlhczjcNiZ+m5Yq2 s/Lw== X-Gm-Message-State: AEkooutcl1xtekCKUTbb0Zp5sBNLzRTz46yzt6N0+0G+ji965wBQVOaU0L9aPcvuOp3XrNAV X-Received: by 10.66.153.163 with SMTP id vh3mr32224493pab.0.1469470466885; Mon, 25 Jul 2016 11:14:26 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id 75sm41796568pfw.92.2016.07.25.11.14.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jul 2016 11:14:26 -0700 (PDT) From: Brian Norris To: Lee Jones , Thierry Reding , Wolfram Sang , Dmitry Torokhov Cc: Olof Johansson , Brian Norris , Javier Martinez Canillas , Enric Balletbo , Shawn Nematbakhsh , Gwendal Grignou , Tomeu Vizoso , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Guenter Roeck , Brian Norris Subject: [PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer() Date: Mon, 25 Jul 2016 11:14:10 -0700 Message-Id: <1469470451-111822-2-git-send-email-briannorris@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1469470451-111822-1-git-send-email-briannorris@chromium.org> References: <1469470451-111822-1-git-send-email-briannorris@chromium.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP cros_ec_cmd_xfer returns success status if the command transport completes successfully, but the execution result is incorrectly ignored. In many cases, the execution result is assumed to be successful, leading to ignored errors and operating on uninitialized data. We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these problems. Let's use it. Signed-off-by: Brian Norris Reviewed-by: Javier Martinez Canillas Acked-by: Wolfram Sang --- drivers/i2c/busses/i2c-cros-ec-tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index a0d95ff682ae..2d5ff86398d0 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c @@ -215,7 +215,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[], msg->outsize = request_len; msg->insize = response_len; - result = cros_ec_cmd_xfer(bus->ec, msg); + result = cros_ec_cmd_xfer_status(bus->ec, msg); if (result < 0) { dev_err(dev, "Error transferring EC i2c message %d\n", result); goto exit;