Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4293000pxk; Tue, 22 Sep 2020 15:56:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD8bIiN6D4gkFCZxnckgiJCIFzGA+rxSZsmY9aTFZg9Tex3v5lW595rR0eKvnSMFBS+v7I X-Received: by 2002:a17:906:eb11:: with SMTP id mb17mr7193093ejb.255.1600815371212; Tue, 22 Sep 2020 15:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600815371; cv=none; d=google.com; s=arc-20160816; b=xGNjVwuMTJr39fNp8LWdGtBun/bWibCl6EbbGA/wWxCi85jUwR5p7DjhAlxtXEudYz 9UOORp23/cbwv0vdSEwIHtVwgZzuG796duNdqtM2AOUj2ZUtqwV0WOdG9qL3oghvQHNw d0b+ozdC/8I53Y50nr+8lU0DAHxy2Osfj936Re5X5GfXPCjqdvgMX7NMhAYfu87j6jmu Kh14gbdHCs7RZMUP8oQpsyVXqeBIykjDURSACss1BRVFLooLxm2pZGE5PmAJHyHR7BSP b0DFtPCGEBZKxaKWsTLMnZNKMBL46FIRcQXSuKxJ6gtbWl+wIfFeC4Mj7dnKPrG6eObl fVZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Sl+YJeRliWSfQxiypGkl3jBHOTrO2+fM5FTcJwbD+6M=; b=r+EiFmt2d2IamTCpWA7d14n3t4fj96PvbndKq6TkPcIbsoSA0HfNpc02N0UIjkVp7k z9Ch7lGXjLGf69ZVVqhRK8knUU8LJBaWAOVKX0MOTVfrXsgsVfTIVsY2G5e7LLDWPzbF /PBk/CoejvaSgD8aOyn33JhNzki1KIoYXvWehkk4MamX8yOMuxjg48SAbt+N8zGA4mvt B+FxVxn/4DAcdQ7AP5t2NdIQZZNn48+cP5vxnldWyIoJpNBb1n5amkl3n8O+zeSMtfB0 8E1M5LAh506I8/9IfiT+rhLAC1DB/O5dW3TK5Y7SSR1f9zW0O6AC9LDLeCPf/8MYLUzT RxeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U4DcHdRj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss23si11377647ejb.350.2020.09.22.15.55.47; Tue, 22 Sep 2020 15:56:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U4DcHdRj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbgIVWwq (ORCPT + 99 others); Tue, 22 Sep 2020 18:52:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbgIVWwe (ORCPT ); Tue, 22 Sep 2020 18:52:34 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4643AC0613D0; Tue, 22 Sep 2020 15:52:34 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id y17so19854257lfa.8; Tue, 22 Sep 2020 15:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sl+YJeRliWSfQxiypGkl3jBHOTrO2+fM5FTcJwbD+6M=; b=U4DcHdRjiPGw/UpfSef4ysBeW5cGPP/Cny/9NTzpkqbhpoXieT38JuxiG7Dunj37Zt 6KuOhQXa87ojALpeMQU1jvitJ1XT4DQRCF3QidIYxLG3+wharsXhJjwIWlrLL3JlhRev lC99rjt+oAOfStksXyCIFqG4IGEptwJEEu7qkIpJsbwXwiauOp7DjfqH3s2dCuxxwks2 JYilnUyQQOrOb+bcZyzjnOC4pZWcReYM/vBIziiYyfAS43oqUWY5SAvi1IJs18Ews6Qr d6/NoH+7MerBYnw4o1k7keGCTZdmd5Cx1GXBvJWzhbVsnZZ3D/I3NOflikAXTi0WiFuW Y9/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sl+YJeRliWSfQxiypGkl3jBHOTrO2+fM5FTcJwbD+6M=; b=Y0bySzFP2MSmX6VN7owRnMLlKNLA4mRK+x3Abjws3wRH4x83/8OLa1Fwa2JbApR9/F UZNAlM2EEe1NCBVwBbVTE20tB3fvM9YGaMQqOu2PrbG5TRDwMMtD1vHslaswOzIErqVX fwSnBktz1+f5K8ar+OhXwMhk6GDFffoMLYvUSOoLdGpXDDN1SxsFdbqKrffgZbRhMxQ/ 6zkgiCG9ZKRIaAvg/J+EdL1arQb2hMy9e0VztVfm6RHTPzKnieaZZ5PUYaBh4FDRlthx THLDT5VgVxNJZFrwRcQiqHcPVbRwLEbXvyDDA/SwQQ4nBDZQ5wdyYxDZlsI5WMZNenFZ 2o9w== X-Gm-Message-State: AOAM532mbp7XFXdQ6fLzsUjCgYm+3BRRfKvjDtlNRLdjkp3iBNoCLvPs ETCKx/yVbd+6+Lo2axW5tFk= X-Received: by 2002:a19:82c3:: with SMTP id e186mr2193404lfd.144.1600815152743; Tue, 22 Sep 2020 15:52:32 -0700 (PDT) Received: from localhost.localdomain (109-252-170-211.dynamic.spd-mgts.ru. [109.252.170.211]) by smtp.gmail.com with ESMTPSA id l15sm3977588lfk.71.2020.09.22.15.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 15:52:32 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Wolfram Sang , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Andy Shevchenko Cc: linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 03/32] i2c: tegra: Handle potential error of tegra_i2c_flush_fifos() Date: Wed, 23 Sep 2020 01:51:26 +0300 Message-Id: <20200922225155.10798-4-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200922225155.10798-1-digetx@gmail.com> References: <20200922225155.10798-1-digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Technically the tegra_i2c_flush_fifos() may fail and transfer should be aborted in this case, but this shouldn't ever happen in practice unless there is a bug somewhere in the driver. Let's add the error check just for completeness. Reviewed-by: Michał Mirosław Reviewed-by: Thierry Reding Tested-by: Thierry Reding Signed-off-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 4e7d0eec0dd3..88d6e7bb14a2 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1177,7 +1177,9 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, bool dma; u16 xfer_time = 100; - tegra_i2c_flush_fifos(i2c_dev); + err = tegra_i2c_flush_fifos(i2c_dev); + if (err) + return err; i2c_dev->msg_buf = msg->buf; i2c_dev->msg_buf_remaining = msg->len; -- 2.27.0