From patchwork Mon Jun 10 17:10:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 166346 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1272993ilk; Mon, 10 Jun 2019 10:12:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqw80Z49k8kIIgvnr4jrutF2CK8b8wFWg78hiBN58tUHchQcvFB7bodGUIHrW3t4YYpwLvXs X-Received: by 2002:a62:ed0a:: with SMTP id u10mr42712591pfh.243.1560186755349; Mon, 10 Jun 2019 10:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560186755; cv=none; d=google.com; s=arc-20160816; b=E4MyiKtrT8HTLcDzgS3el3sHfJFEdyscwAjdCe+5DJR5QQFFUteZJhryANh7sDmt3c wGaTHifzfrBkQ4bZMNSeLxy4gSpQ9EzTF2YC9EIS0ZpSe6EBKV0gALWsB9pta7SaxaQ6 hkYqECzaYMAdHHoW4pfYygpRHorbTefa4h70eeFsBBKqm3QwLpFfZO0qHWEAi2fqFWjf tM4vavyuofSAUzm02Kw3qetXs4m9r68cqZmvIni1b7SuIl7mVpiullm9MZf8y5bjThyi MIKOJXP25pkQDZ1wW9Rqspg2mxzmBjMADP8z7VKjhpHcqkpKo8DAOgDNNI4tF7PM/y7S Hogg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ew1K6dc7XJ3Lz8pVJ6FwwRkOUCloXwI4ODLhOfwKs2A=; b=MFJf7h/czEV/xhPV0Mi3ann5orVik8xUGFfh9zobuAlZ6B50+H/LZoUvDFob5XEX0q gFlXqudu11oqWlt+aqXalnYUwj9gI5ke1o377MBOoTXcEH4bJx5GclQj2Xw1gOdkSWPz /yNS2IWzsdKWrDHcmtLTFwDzMy1cuaTT008MKgBRr35CXbgbb4Le94xa3EIXg4cgh44R LeTSSSZzkr9oN2be8XluxOzNOYpjn8e3R/QxvZAZ1KQoezpbaog041eCB0z776WFgUcv LZt+1kSKtrXggSXN+hzsA3A6BvXj1ofcTwHH/qaoE0Tf3sByzph+jHeWj1I68ebncKNE RjVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NHJP3aYQ; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si21913pjq.31.2019.06.10.10.12.35; Mon, 10 Jun 2019 10:12:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NHJP3aYQ; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388342AbfFJRMd (ORCPT + 5 others); Mon, 10 Jun 2019 13:12:33 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:58034 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388341AbfFJRMc (ORCPT ); Mon, 10 Jun 2019 13:12:32 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x5AHCQUD110035; Mon, 10 Jun 2019 12:12:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1560186746; bh=Ew1K6dc7XJ3Lz8pVJ6FwwRkOUCloXwI4ODLhOfwKs2A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NHJP3aYQ5nFeClYJ+sqWP4MdxtcIfaH7GesHywLvY6k7YAh1v0O80jXr+NlmoGmo2 JhpvOw4f5Uk3hAVUMpt9s8bgdgo1NSTyRWyhh6nTdrbVkEocaCHbZh36ozSUIXZLPG PNlZl1J3aoexuCJAMSvQ4ECvh/lvlR7wGJ9ZEeHw= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x5AHCPxK011206 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2019 12:12:25 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 10 Jun 2019 12:12:25 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 10 Jun 2019 12:12:25 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x5AHCOJR051660; Mon, 10 Jun 2019 12:12:25 -0500 From: Grygorii Strashko To: Russell King , Linus Walleij , Tony Lindgren CC: Bartosz Golaszewski , , , , Santosh Shilimkar , Russell King , Grygorii Strashko Subject: [PATCH-next 11/20] gpio: gpio-omap: simplify bank->level_mask Date: Mon, 10 Jun 2019 20:10:54 +0300 Message-ID: <20190610171103.30903-12-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190610171103.30903-1-grygorii.strashko@ti.com> References: <20190610171103.30903-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Russell King bank->level_mask is merely the bitwise or of the level detection context which we have already read in this function. Rather than repeating additional reads, compute it from the values already read. Signed-off-by: Russell King Signed-off-by: Grygorii Strashko --- drivers/gpio/gpio-omap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 8fdac6e4a929..369ce46e2b09 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -325,6 +325,9 @@ static inline void omap_set_gpio_trigger(struct gpio_bank *bank, int gpio, bank->context.fallingdetect = readl_relaxed(bank->base + bank->regs->fallingdetect); + bank->level_mask = bank->context.leveldetect0 | + bank->context.leveldetect1; + if (likely(!(bank->non_wakeup_gpios & gpio_bit))) { omap_gpio_rmw(base, bank->regs->wkup_en, gpio_bit, trigger != 0); bank->context.wake_en = @@ -344,10 +347,6 @@ static inline void omap_set_gpio_trigger(struct gpio_bank *bank, int gpio, else bank->enabled_non_wakeup_gpios &= ~gpio_bit; } - - bank->level_mask = - readl_relaxed(bank->base + bank->regs->leveldetect0) | - readl_relaxed(bank->base + bank->regs->leveldetect1); } #ifdef CONFIG_ARCH_OMAP1