]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: brcmstb: Utilize irqd_to_hwirq(d) instead of d->hwirq
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Wed, 4 Feb 2026 16:43:31 +0000 (08:43 -0800)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Mon, 23 Feb 2026 09:38:32 +0000 (10:38 +0100)
Consistently use irqd_to_hwirq(d) which is the recommended helper to
fetch the hardware IRQ number from an irq_data structure. While at it,
update the brcmstb_gpio_set_imask() function signature to use the proper
type for the "hwirq" argument rather than "unsigned int".

Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260204164333.1146039-2-florian.fainelli@broadcom.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-brcmstb.c

index 2352d099709c2b409c48cf450fa4e799af4c89d2..4c35ed664f65317c1dde170c19d7037c7ff650cb 100644 (file)
@@ -96,7 +96,7 @@ static int brcmstb_gpio_hwirq_to_offset(irq_hw_number_t hwirq,
 }
 
 static void brcmstb_gpio_set_imask(struct brcmstb_gpio_bank *bank,
-               unsigned int hwirq, bool enable)
+                                  irq_hw_number_t hwirq, bool enable)
 {
        struct brcmstb_gpio_priv *priv = bank->parent_priv;
        u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(hwirq, bank));
@@ -132,7 +132,7 @@ static void brcmstb_gpio_irq_mask(struct irq_data *d)
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
 
-       brcmstb_gpio_set_imask(bank, d->hwirq, false);
+       brcmstb_gpio_set_imask(bank, irqd_to_hwirq(d), false);
 }
 
 static void brcmstb_gpio_irq_unmask(struct irq_data *d)
@@ -140,7 +140,7 @@ static void brcmstb_gpio_irq_unmask(struct irq_data *d)
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
 
-       brcmstb_gpio_set_imask(bank, d->hwirq, true);
+       brcmstb_gpio_set_imask(bank, irqd_to_hwirq(d), true);
 }
 
 static void brcmstb_gpio_irq_ack(struct irq_data *d)
@@ -148,7 +148,7 @@ static void brcmstb_gpio_irq_ack(struct irq_data *d)
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
        struct brcmstb_gpio_priv *priv = bank->parent_priv;
-       u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(d->hwirq, bank));
+       u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(irqd_to_hwirq(d), bank));
 
        gpio_generic_write_reg(&bank->chip,
                               priv->reg_base + GIO_STAT(bank->id), mask);
@@ -159,7 +159,7 @@ static int brcmstb_gpio_irq_set_type(struct irq_data *d, unsigned int type)
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
        struct brcmstb_gpio_priv *priv = bank->parent_priv;
-       u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(d->hwirq, bank));
+       u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(irqd_to_hwirq(d), bank));
        u32 edge_insensitive, iedge_insensitive;
        u32 edge_config, iedge_config;
        u32 level, ilevel;
@@ -236,7 +236,7 @@ static int brcmstb_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
        struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
        struct brcmstb_gpio_priv *priv = bank->parent_priv;
-       u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(d->hwirq, bank));
+       u32 mask = BIT(brcmstb_gpio_hwirq_to_offset(irqd_to_hwirq(d), bank));
 
        /*
         * Do not do anything specific for now, suspend/resume callbacks will