From patchwork Tue Sep 1 21:10:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 254856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3AE8C433E6 for ; Tue, 1 Sep 2020 21:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AE65207D3 for ; Tue, 1 Sep 2020 21:12:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="emqPFT9M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729673AbgIAVMm (ORCPT ); Tue, 1 Sep 2020 17:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729020AbgIAVLf (ORCPT ); Tue, 1 Sep 2020 17:11:35 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 905AAC061245; Tue, 1 Sep 2020 14:11:34 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id a15so3304638ljk.2; Tue, 01 Sep 2020 14:11: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=dET0JzECK8CtHPygKgo78u1ZJ6NkxyMLuHDUClj7AMw=; b=emqPFT9MZ5MzoPt8KRw6cJRwm8IdQLrD8XVObCdwoSG5Vyvi37g1xOqN4IPqhztt3l D43G9faSazCJpjfwoJEoJHamI4PLUjw/C5wMqr7Ux5UtEnb644RRWDwtpp46KJDhOgmu MJFRoBeJC3cxo2P9s0QA0FPEY+VLLaIzaN86Arn1sQBb4tgqDD4w0kyhVeWJGSmFgI2k h/wBHVb6FWc7VsZxWTae7y6WXCD4+dvmNpiByyJz1xu7U35OkxuuO9bBWDM/EtfXe4c9 5HYIZrTsOyhUJKpfh190S55sTmc2izRHMSHXz8IvtlJhdeVOqzfKf1YKPoG6zDoI7EIj UErw== 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=dET0JzECK8CtHPygKgo78u1ZJ6NkxyMLuHDUClj7AMw=; b=esmU7tOk8SyM3D9oFOIoWaydu6zlO7vLuXNhjyF6vfWH09+DGVmwpNtskdULxo5zXL 8HHTGP829BbzgwyXalRBCQzAb+pHdam8X+1XmbPwu5++jlVVdJEOKJAcgTThrWqClBTN nsCnLnXtM/PHTw0spiv3EbJoOKGJOe4kZ2mfi3/XMCyrBW9ez2cmBgk0WnV537JWuqw8 364GjjUUeTOxgh7dGsLdiVNLorge6LZKbjidf+0xlywriwLsepPiP2TCin/f4uwntt0X osRDDmsJp3uQjf0yMMvoGnnN10P97zlvwzSYdA3j7gteT5biXwEq/wm7FyMBgjlFP6c6 zEMg== X-Gm-Message-State: AOAM531CQPgF7Y+KnF+PIGHtn/kZqIH2MJTRxzKoAD9vkDh9LclHQ5WC /5xVl81SdwjygY1mSJ7DZps= X-Google-Smtp-Source: ABdhPJy6W6tslvIXa1o3bxUn0pHlnGL2jL0VLYc9Z5KOGszJy+ZWWZwet8jlxqthDLECxxBkFOB1tw== X-Received: by 2002:a05:651c:552:: with SMTP id q18mr1539028ljp.248.1598994693060; Tue, 01 Sep 2020 14:11:33 -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 g19sm502656ljk.125.2020.09.01.14.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 14:11:32 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/17] i2c: tegra: Drop '_timeout' from wait/poll function names Date: Wed, 2 Sep 2020 00:10:55 +0300 Message-Id: <20200901211102.11072-11-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200901211102.11072-1-digetx@gmail.com> References: <20200901211102.11072-1-digetx@gmail.com> MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Drop '_timeout' postfix from the wait/poll completion function names in order to make the names shorter, making code cleaner a tad. Signed-off-by: Dmitry Osipenko --- drivers/i2c/busses/i2c-tegra.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index a8f6a32229c3..3d6189e200ba 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1067,10 +1067,9 @@ static void tegra_i2c_config_fifo_trig(struct tegra_i2c_dev *i2c_dev, i2c_writel(i2c_dev, val, reg); } -static unsigned long -tegra_i2c_poll_completion_timeout(struct tegra_i2c_dev *i2c_dev, - struct completion *complete, - unsigned int timeout_ms) +static unsigned long tegra_i2c_poll_completion(struct tegra_i2c_dev *i2c_dev, + struct completion *complete, + unsigned int timeout_ms) { ktime_t ktime = ktime_get(); ktime_t ktimeout = ktime_add_ms(ktime, timeout_ms); @@ -1094,16 +1093,14 @@ tegra_i2c_poll_completion_timeout(struct tegra_i2c_dev *i2c_dev, return 0; } -static unsigned long -tegra_i2c_wait_completion_timeout(struct tegra_i2c_dev *i2c_dev, - struct completion *complete, - unsigned int timeout_ms) +static unsigned long tegra_i2c_wait_completion(struct tegra_i2c_dev *i2c_dev, + struct completion *complete, + unsigned int timeout_ms) { unsigned long ret; if (i2c_dev->is_curr_atomic_xfer) { - ret = tegra_i2c_poll_completion_timeout(i2c_dev, complete, - timeout_ms); + ret = tegra_i2c_poll_completion(i2c_dev, complete, timeout_ms); } else { enable_irq(i2c_dev->irq); ret = wait_for_completion_timeout(complete, @@ -1121,8 +1118,7 @@ tegra_i2c_wait_completion_timeout(struct tegra_i2c_dev *i2c_dev, * needs to be checked after timeout. */ if (ret == 0) - ret = tegra_i2c_poll_completion_timeout(i2c_dev, - complete, 0); + ret = tegra_i2c_poll_completion(i2c_dev, complete, 0); } return ret; @@ -1149,8 +1145,8 @@ static int tegra_i2c_issue_bus_clear(struct i2c_adapter *adap) i2c_writel(i2c_dev, reg, I2C_BUS_CLEAR_CNFG); tegra_i2c_unmask_irq(i2c_dev, I2C_INT_BUS_CLR_DONE); - time_left = tegra_i2c_wait_completion_timeout( - i2c_dev, &i2c_dev->msg_complete, 50); + time_left = tegra_i2c_wait_completion(i2c_dev, &i2c_dev->msg_complete, + 50); if (time_left == 0) { dev_err(i2c_dev->dev, "timed out for bus clear\n"); return -ETIMEDOUT; @@ -1296,8 +1292,9 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, i2c_readl(i2c_dev, I2C_INT_MASK)); if (dma) { - time_left = tegra_i2c_wait_completion_timeout( - i2c_dev, &i2c_dev->dma_complete, xfer_time); + time_left = tegra_i2c_wait_completion(i2c_dev, + &i2c_dev->dma_complete, + xfer_time); /* * Synchronize DMA first, since dmaengine_terminate_sync() @@ -1328,8 +1325,8 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, } } - time_left = tegra_i2c_wait_completion_timeout( - i2c_dev, &i2c_dev->msg_complete, xfer_time); + time_left = tegra_i2c_wait_completion(i2c_dev, &i2c_dev->msg_complete, + xfer_time); tegra_i2c_mask_irq(i2c_dev, int_mask);