Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp68686lqk; Wed, 13 Mar 2024 16:57:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUK8g+XxYJtHv6ur09PpLhUA2nBFFA8ArkExvFisc6rFF88AQC12uQdWulvxiiq56F7+exofWx3xGeGEpaAt5DHq9elaYn/j4l1QYbVUQ== X-Google-Smtp-Source: AGHT+IGMVr1DchIJKp7TQlLmDX4hUYanhJrgQIyQxEjerXCMSWIW0fKL0y651gbIXSfFJma80D+I X-Received: by 2002:a17:906:2bd3:b0:a46:268b:228a with SMTP id n19-20020a1709062bd300b00a46268b228amr3574653ejg.29.1710374233834; Wed, 13 Mar 2024 16:57:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710374233; cv=pass; d=google.com; s=arc-20160816; b=OZvGWILOcBtTw9zwmfDS3UtdbLIobU5ESfmqk8kGWt+DgogVCg7X6SDVF+XIg23a29 Mfd95yygerZh8B4GBXw1qudnT2ofJisKeTEPmed4HRA6t5ND57YOVS3FUn76bZAPg+mm m2jsC/vTrcy1GOSjqjgEArn+4WRrBOWaY7a6p4nUXt1DOwuKXGJlHouRShU0b2rwRO7p wDvYWYMe90dgShcuvzWsqkw1ijCE3BioYRmivC+QtIOWtaDMf14anxvXHC3yaq96s28c vxNqS6aJh/a3baf4gZJuu8Td53wdNGYFoGNqmyGSar28+EuVzaUZx6Gc/ckZpOgLHzvy /Xrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from; bh=7SuOpglpH6CHi61X93xTMZ+gezXGOg1LVzaG0vvA6JU=; fh=YgUZ2/lPRGLRG7A+awv03LUUmaPSy2eh3E767EmTYHs=; b=LxrL5T89AJeB+Vj1hcNa+1eo86u82ccK8lTnlzEvrluostfOWaAirMq7LhnyLsxtz9 nlpryg2lfTHcCPxvriiXIO2GzY6/0/J+6nHqsfzcLFeF7w1cBdQfnFoQ5ffRnjE+Jz/M Ick3XY45IgvbSCkYLQS/7t1kRWYFdGXmFFQQ+8VNusEoKYNYjlSxi04WZe7I5dt+WpVV waPL5IjOkvIFJ/t8giql3KxqEb0d/9nG5p6bTPVkItd/981WY+I7ojfDXe9HUuksAeOb t/LZv3brZVWsNWL/FK13Xx9veZBNiAiqwvH19uOW0WU/0qE5Y8A3O2N2das9EMC2k4pD k+fA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l22-20020a170906795600b00a45c283660asi156585ejo.119.2024.03.13.16.57.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 16:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8F1091F22EB7 for ; Wed, 13 Mar 2024 23:57:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CE415EE81; Wed, 13 Mar 2024 23:55:40 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 475135D8F6 for ; Wed, 13 Mar 2024 23:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; cv=none; b=AxbLfND+wSoOKLZf3PR8b05sn/yUOB5Da5B4yrj4EKJSPdU/WMDu1uCwg5oUXf3BDpeT2TFB1dn3HaL0vrhcWms7ivZXx58cdcqtAXeYFf+yOeaTdOu1NRj7gXM6M1u4GeEwSYWczEYIOufMOXh+9odeRA+snODKUFUitwwCH5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; c=relaxed/simple; bh=/2xiYsQiRb+aViv4WHP41Tr0LGskzf2GigCrhrMxVnw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HhG8CsP3YWddgefF6V9AHwGr+kCa5olrQAliuKP8drIWpSL05EUCN5iz8RTi7lmqgkR6XPtDLe9KpqIaKvDvrAsGoDAuOJPT0nYgFYdyPkJ2w4k2M5ceZjAHE5KujVLE9//2H4iqYOWEcW1EvA8oe5XJwqYsXQpME8RpAuMV1w0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 076695d5-e195-11ee-abf4-005056bdd08f; Thu, 14 Mar 2024 01:54:28 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 05/11] pinctrl: aw9523: Use temporary variable for HW IRQ number Date: Thu, 14 Mar 2024 01:52:08 +0200 Message-ID: <20240313235422.180075-6-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are two different ways on how to get HW IRQ number in some functions. Unify that by using temporary variable and irqd_to_hwirq() call. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-aw9523.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9523.c index 79916e6bf6f4e..118896373844a 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -428,12 +428,12 @@ static int aw9523_gpio_irq_type(struct irq_data *d, unsigned int type) static void aw9523_irq_mask(struct irq_data *d) { struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d)); - unsigned int n = d->hwirq % AW9523_PINS_PER_PORT; + irq_hw_number_t hwirq = irqd_to_hwirq(d); + unsigned int n = hwirq % AW9523_PINS_PER_PORT; - regmap_update_bits(awi->regmap, - AW9523_REG_INTR_DIS(d->hwirq), + regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq), BIT(n), BIT(n)); - gpiochip_disable_irq(&awi->gpio, irqd_to_hwirq(d)); + gpiochip_disable_irq(&awi->gpio, hwirq); } /* @@ -446,11 +446,11 @@ static void aw9523_irq_mask(struct irq_data *d) static void aw9523_irq_unmask(struct irq_data *d) { struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d)); - unsigned int n = d->hwirq % AW9523_PINS_PER_PORT; + irq_hw_number_t hwirq = irqd_to_hwirq(d); + unsigned int n = hwirq % AW9523_PINS_PER_PORT; - gpiochip_enable_irq(&awi->gpio, irqd_to_hwirq(d)); - regmap_update_bits(awi->regmap, - AW9523_REG_INTR_DIS(d->hwirq), + gpiochip_enable_irq(&awi->gpio, hwirq); + regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq), BIT(n), 0); } -- 2.44.0