From mboxrd@z Thu Jan 1 00:00:00 1970 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,URIBL_BLOCKED,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 6C4FFC433E2 for ; Sat, 5 Sep 2020 20:45:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3392220760 for ; Sat, 5 Sep 2020 20:45:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uCTuO//O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728960AbgIEUpH (ORCPT ); Sat, 5 Sep 2020 16:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728733AbgIEUmo (ORCPT ); Sat, 5 Sep 2020 16:42:44 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E9A2C061244; Sat, 5 Sep 2020 13:42:43 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id a15so11865671ljk.2; Sat, 05 Sep 2020 13:42:43 -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=F6IQIXYvsL3aa3SXKlTJnwYnxXforxZyxrRnlOS1lNQ=; b=uCTuO//Ol6w1ncO+DNY0eEUMHa75qmPZpEttVTcM7uNjntbmQUouVBpd/dwc9t96X6 6iNyjN9lXaG/aoOqvwxF/lP2aToB0jN3lErOpE41erZpJlJO5ke9vvW6jOdMHIwBbrsp SkPiXGl5R3gQTlHW0W9dLkfss/Ci/Se6JZB7mdd3qB/o2xa4cqKyhOsasCUfVdHk1eVR Cp6oxYNxcvpmez+Q19gbtAyunNqm0G6wIW/9n3DB/PAAyZUE8VmyaXHY8V100Af37LwU ACaplK8Ao8osrzByaKdaQd3QA1HsRdTnw/6QukAgRRe5LkQrh3QcKQHAzMePyVfeeeSL 5RvQ== 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=F6IQIXYvsL3aa3SXKlTJnwYnxXforxZyxrRnlOS1lNQ=; b=kcGE+4FvWFJ7//I9nrZWVCkTzVnqjj7KJdzGzPHlhn7vzeeS7n+PmAjqlsF7L6g+nY OAdYRVpmS0IVL+TruEJeXovFMKk573zg8HjQjfYJ49YETmsdbSNX9k4jmJwOvPzIppuS t25aIpqvRHNiCenyxt5WDnQbMBeIqVO9FUr2DjoGJuWzYBPzfN+0x+Rl+0DgvYIYYv/Q u/A1BRJy8105fGqOaU1vhhbn0/gl09Qe+9WRmwREyU/ZS1s804Jf/3nIA2tzSTM9p89m +BMLTPuD6Wlo/7UXgdR4Xp8zWQ0A+M6K9P4RE3IvTIIn87M3aUxIcWwMZjDuwBYwDAtj 53+w== X-Gm-Message-State: AOAM531jQtMWkkGOpABGvUNRmjsDV+KK3hpyglQxn+lJkCOMLs5P1oar yZjvijYSfcojpkx3UwUTT1I= X-Google-Smtp-Source: ABdhPJx1OIKo6i3+ytL1ZMQlXtshuFxDfmVgATqLhfGzjUyiaGoikl6kmH9ai8tx2Py/IOeKE7YdpQ== X-Received: by 2002:a2e:918f:: with SMTP id f15mr6853658ljg.435.1599338562061; Sat, 05 Sep 2020 13:42:42 -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 e17sm1677763ljn.18.2020.09.05.13.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 13:42:41 -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 v4 19/31] i2c: tegra: Rename wait/poll functions Date: Sat, 5 Sep 2020 23:41:39 +0300 Message-Id: <20200905204151.25343-20-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200905204151.25343-1-digetx@gmail.com> References: <20200905204151.25343-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 Drop '_timeout' postfix from the wait/poll completion function names in order to make the names shorter, making code cleaner a tad. Reviewed-by: Michał Mirosław 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 dc9948d816ac..c2ff55e8db54 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1039,10 +1039,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); @@ -1066,16 +1065,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, @@ -1093,8 +1090,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; @@ -1121,8 +1117,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; @@ -1270,8 +1266,9 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, i2c_readl(i2c_dev, I2C_INT_MASK)); if (i2c_dev->is_curr_dma_xfer) { - 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() @@ -1302,8 +1299,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); -- 2.27.0