Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4273308pxk; Tue, 8 Sep 2020 15:42:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweaH/eBzrcgyAvL7M6pQA+hSjgiSKax1+zeKQNDPIQivEb7F5SSbE2nY2ULAtIoIG1ISIf X-Received: by 2002:a05:6402:304f:: with SMTP id bu15mr1271067edb.201.1599604948907; Tue, 08 Sep 2020 15:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599604948; cv=none; d=google.com; s=arc-20160816; b=vIn5fNuNPGsI2wtRDmgcLv/mureAkEpr/nKeM1HDzHvKAyrZEQNyXqucoKWyv5A4iQ vMUaQTULGK8ey+j/5czil2jhNt6yFryjEVJcIDNBZpIZq2tPclukgyeY76nN7APe24pd cSCtpffRxWPdY8cNqoY1SBPdj4TK4FNIFfsIhb6agR0u2TC5ukB9PKssWMa9xG/UkUjl 5XVE3F3etQVggeXIis9M2YL2PzQlXsNRv1jwEp8XnYlA35KyunckfHlAYvmGFexSK9IZ CG28/A9ZOyNOE33YWpVB6235ZCM/TpS2a5JQh8oG2sOJWFFxIIVi0a6eT5FmWghmCPtv 9Xow== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8EoeQfm2V7iEFCAPBa5UMm2YWlodiF1UtVHJ3u58T+Y=; b=e42oiGY0hkkMhcFDDDCRH8fBebyuphuT25yzyZW0ve5VYbCvw4M59itbJypF9MJbN9 WGtDuqkdHL6Usl5KBuMrW6S+A71kR224Y1fxvdWTFx239cB5RssNane9Rt6rFpoPNxsJ 3+Vjx+WEXGNeyrGYL+oJ7H58fZo69YrTOuWr+XBFWQdQSj/E6wPfOZiKKRa/fTcN89iT d+2Yt31GGqflpMLchZwVNIx/ycKEwyYf0o8ZCZHyOc+U4kblDfkY8g5HDQqzn7/plcJI Q13pW1XsnfC/D1HaZl5C/zlhHEAdN5eLTZVTl8RsSfSlKNpzu7LCtxs58aixsc9tu8Rj X7vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="DeyKLD//"; 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 e1si292952edn.2.2020.09.08.15.42.05; Tue, 08 Sep 2020 15:42:28 -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="DeyKLD//"; 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 S1730064AbgIHWky (ORCPT + 99 others); Tue, 8 Sep 2020 18:40:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729663AbgIHWk2 (ORCPT ); Tue, 8 Sep 2020 18:40:28 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A61E2C061755; Tue, 8 Sep 2020 15:40:27 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id u4so940800ljd.10; Tue, 08 Sep 2020 15:40:27 -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=8EoeQfm2V7iEFCAPBa5UMm2YWlodiF1UtVHJ3u58T+Y=; b=DeyKLD//BU8Ez6r28Edj0FvXCyEA1O2F6QmsnIh9wMrf9GW5Z+A4KjoD9OT4dB0WFh A3HOjyFw0mMTISgaEkj2vprkCycg1qRVBC49UG5CCeqrkA3DdmfmMOKo2OQKZOBb3OVg B/wv3D3b45vdadhCMkkh0D98Fkd80pN3BHiXqZwUmAmt47OG5blZdxCvAsIxrjA/PasB tJpXKH8UMlJjgVyxfkARgrMTDQiQfET3V8xZ5F/9cI3ucTcrtW+HpOS2/NUQ3CS78rJy b5IDMJ14obStxky4odGdJ/ORjj3XJUXjnftAGAuUEqVqfa/ItI2Mtn7pHp6WHBmmh6Ji +ogg== 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=8EoeQfm2V7iEFCAPBa5UMm2YWlodiF1UtVHJ3u58T+Y=; b=eeH3slvAFKEbwXAQtLCIscixr7Z5laHAoCZZj+jTkGWlbkBdl7AsgJgyRoooB0q1RD UXqWNazSKlnrTVcWKRZynmVLpmPTENNKz7kXKiE4xBk00GcOuVchDsxxx0QMP5FEtuyp DZ9NKf/e2kJNcAR3Cj/iALLwx9vabhK/YcIGQpprFNzD0iD9wMcuIZIrAcw+TliiCPWG pFJrQF7K/f5uWzctckbD9bpTlI9ink3luseJ3EwbU/o32G53V1XM+49niCTXu2VUg/P5 OiAUSr/DOJKPYmCsLvTsiskJnOraGjQhOSjF8h/2UAM74lRWOFDoOFE2a+ZFvsasL3sC YGrA== X-Gm-Message-State: AOAM533O+r79U93jlAbLnEBfZtXX4R+TJZn1Fx6hYfQcAkN8Fy6p/unU j/hplfl1WDydu3DmzXezD4A= X-Received: by 2002:a05:651c:134a:: with SMTP id j10mr352391ljb.337.1599604825884; Tue, 08 Sep 2020 15:40:25 -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 s15sm268311ljp.25.2020.09.08.15.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 15:40:25 -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 v7 03/34] i2c: tegra: Handle potential error of tegra_i2c_flush_fifos() Date: Wed, 9 Sep 2020 01:39:35 +0300 Message-Id: <20200908224006.25636-4-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908224006.25636-1-digetx@gmail.com> References: <20200908224006.25636-1-digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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 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