98a1310ad528371fa84668ba2982b5000d9255d8
[openwrt/openwrt.git] /
1 From 66413f0468d35adb352c76bc286bf6f6746ba354 Mon Sep 17 00:00:00 2001
2 From: Andy Shevchenko <andy.shevchenko@gmail.com>
3 Date: Fri, 29 Mar 2024 12:55:19 +0200
4 Subject: [PATCH] pinctrl: aw9523: Use temporary variable for HW IRQ number
5
6 There are two different ways on how to get HW IRQ number in some functions.
7 Unify that by using temporary variable and irqd_to_hwirq() call.
8
9 Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
10 Message-ID: <20240329105634.712457-6-andy.shevchenko@gmail.com>
11 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 ---
13 drivers/pinctrl/pinctrl-aw9523.c | 16 ++++++++--------
14 1 file changed, 8 insertions(+), 8 deletions(-)
15
16 --- a/drivers/pinctrl/pinctrl-aw9523.c
17 +++ b/drivers/pinctrl/pinctrl-aw9523.c
18 @@ -428,12 +428,12 @@ static int aw9523_gpio_irq_type(struct i
19 static void aw9523_irq_mask(struct irq_data *d)
20 {
21 struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
22 - unsigned int n = d->hwirq % AW9523_PINS_PER_PORT;
23 + irq_hw_number_t hwirq = irqd_to_hwirq(d);
24 + unsigned int n = hwirq % AW9523_PINS_PER_PORT;
25
26 - regmap_update_bits(awi->regmap,
27 - AW9523_REG_INTR_DIS(d->hwirq),
28 + regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq),
29 BIT(n), BIT(n));
30 - gpiochip_disable_irq(&awi->gpio, irqd_to_hwirq(d));
31 + gpiochip_disable_irq(&awi->gpio, hwirq);
32 }
33
34 /*
35 @@ -446,11 +446,11 @@ static void aw9523_irq_mask(struct irq_d
36 static void aw9523_irq_unmask(struct irq_data *d)
37 {
38 struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
39 - unsigned int n = d->hwirq % AW9523_PINS_PER_PORT;
40 + irq_hw_number_t hwirq = irqd_to_hwirq(d);
41 + unsigned int n = hwirq % AW9523_PINS_PER_PORT;
42
43 - gpiochip_enable_irq(&awi->gpio, irqd_to_hwirq(d));
44 - regmap_update_bits(awi->regmap,
45 - AW9523_REG_INTR_DIS(d->hwirq),
46 + gpiochip_enable_irq(&awi->gpio, hwirq);
47 + regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq),
48 BIT(n), 0);
49 }
50