Skip to content

Commit 66413f0

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: aw9523: Use temporary variable for HW IRQ number
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 <[email protected]> Message-ID: <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 418ee94 commit 66413f0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/pinctrl/pinctrl-aw9523.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,12 @@ static int aw9523_gpio_irq_type(struct irq_data *d, unsigned int type)
428428
static void aw9523_irq_mask(struct irq_data *d)
429429
{
430430
struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
431-
unsigned int n = d->hwirq % AW9523_PINS_PER_PORT;
431+
irq_hw_number_t hwirq = irqd_to_hwirq(d);
432+
unsigned int n = hwirq % AW9523_PINS_PER_PORT;
432433

433-
regmap_update_bits(awi->regmap,
434-
AW9523_REG_INTR_DIS(d->hwirq),
434+
regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq),
435435
BIT(n), BIT(n));
436-
gpiochip_disable_irq(&awi->gpio, irqd_to_hwirq(d));
436+
gpiochip_disable_irq(&awi->gpio, hwirq);
437437
}
438438

439439
/*
@@ -446,11 +446,11 @@ static void aw9523_irq_mask(struct irq_data *d)
446446
static void aw9523_irq_unmask(struct irq_data *d)
447447
{
448448
struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
449-
unsigned int n = d->hwirq % AW9523_PINS_PER_PORT;
449+
irq_hw_number_t hwirq = irqd_to_hwirq(d);
450+
unsigned int n = hwirq % AW9523_PINS_PER_PORT;
450451

451-
gpiochip_enable_irq(&awi->gpio, irqd_to_hwirq(d));
452-
regmap_update_bits(awi->regmap,
453-
AW9523_REG_INTR_DIS(d->hwirq),
452+
gpiochip_enable_irq(&awi->gpio, hwirq);
453+
regmap_update_bits(awi->regmap, AW9523_REG_INTR_DIS(hwirq),
454454
BIT(n), 0);
455455
}
456456

0 commit comments

Comments
 (0)