linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@somainline.org>,
	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	[thread overview]
Message-ID: <20240313235422.180075-6-andy.shevchenko@gmail.com> (raw)
In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com>

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 <andy.shevchenko@gmail.com>
---
 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


  parent reply	other threads:[~2024-03-13 23:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 23:52 [PATCH v1 00/11] pinctrl: aw9523: number of cleanups Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 01/11] pinctrl: aw9523: Destroy mutex on ->remove() Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 02/11] pinctrl: aw9523: Use correct error code for not supported functionality Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 03/11] pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple() Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 04/11] pinctrl: aw9523: Make use of struct pinfunction and PINCTRL_PINFUNCTION() Andy Shevchenko
2024-03-14 22:22   ` kernel test robot
2024-03-15 11:12   ` kernel test robot
2024-03-13 23:52 ` Andy Shevchenko [this message]
2024-03-13 23:52 ` [PATCH v1 06/11] pinctrl: aw9523: Get rid of redundant ' & U8_MAX' pieces Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 07/11] pinctrl: aw9523: Remove unused irqchip field in struct aw9523_irq Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 08/11] pinctrl: aw9523: Make use of dev_err_probe() Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 09/11] pinctrl: aw9523: Sort headers and group pinctrl/* Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 10/11] pinctrl: aw9523: Fix indentation in a few places Andy Shevchenko
2024-03-13 23:52 ` [PATCH v1 11/11] pinctrl: aw9523: Remove redundant dependency to OF Andy Shevchenko
2024-03-14  7:04 ` [PATCH v1 00/11] pinctrl: aw9523: number of cleanups Dan Carpenter
2024-03-28  9:21 ` Linus Walleij
2024-03-28 14:14   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240313235422.180075-6-andy.shevchenko@gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=angelogioacchino.delregno@somainline.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).