Skip to content

Commit a30be40

Browse files
MrVanBartosz Golaszewski
authored andcommitted
gpio: grgpio: Make irq_chip immutable
Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Constify grgpio_irq_chip, flag the irq_chip as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250509-gpio-v1-2-639377c98288@nxp.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 7b04f98 commit a30be40

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/gpio/gpio-grgpio.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ static void grgpio_irq_mask(struct irq_data *d)
170170
grgpio_set_imask(priv, offset, 0);
171171

172172
raw_spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
173+
174+
gpiochip_disable_irq(&priv->gc, d->hwirq);
173175
}
174176

175177
static void grgpio_irq_unmask(struct irq_data *d)
@@ -178,18 +180,21 @@ static void grgpio_irq_unmask(struct irq_data *d)
178180
int offset = d->hwirq;
179181
unsigned long flags;
180182

183+
gpiochip_enable_irq(&priv->gc, d->hwirq);
181184
raw_spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
182185

183186
grgpio_set_imask(priv, offset, 1);
184187

185188
raw_spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
186189
}
187190

188-
static struct irq_chip grgpio_irq_chip = {
191+
static const struct irq_chip grgpio_irq_chip = {
189192
.name = "grgpio",
190193
.irq_mask = grgpio_irq_mask,
191194
.irq_unmask = grgpio_irq_unmask,
192195
.irq_set_type = grgpio_irq_set_type,
196+
.flags = IRQCHIP_IMMUTABLE,
197+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
193198
};
194199

195200
static irqreturn_t grgpio_irq_handler(int irq, void *dev)

0 commit comments

Comments
 (0)