mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
7b04f98027
commit
a30be40bf1
1 changed files with 6 additions and 1 deletions
|
@ -170,6 +170,8 @@ static void grgpio_irq_mask(struct irq_data *d)
|
|||
grgpio_set_imask(priv, offset, 0);
|
||||
|
||||
raw_spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
|
||||
|
||||
gpiochip_disable_irq(&priv->gc, d->hwirq);
|
||||
}
|
||||
|
||||
static void grgpio_irq_unmask(struct irq_data *d)
|
||||
|
@ -178,6 +180,7 @@ static void grgpio_irq_unmask(struct irq_data *d)
|
|||
int offset = d->hwirq;
|
||||
unsigned long flags;
|
||||
|
||||
gpiochip_enable_irq(&priv->gc, d->hwirq);
|
||||
raw_spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
|
||||
|
||||
grgpio_set_imask(priv, offset, 1);
|
||||
|
@ -185,11 +188,13 @@ static void grgpio_irq_unmask(struct irq_data *d)
|
|||
raw_spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
|
||||
}
|
||||
|
||||
static struct irq_chip grgpio_irq_chip = {
|
||||
static const struct irq_chip grgpio_irq_chip = {
|
||||
.name = "grgpio",
|
||||
.irq_mask = grgpio_irq_mask,
|
||||
.irq_unmask = grgpio_irq_unmask,
|
||||
.irq_set_type = grgpio_irq_set_type,
|
||||
.flags = IRQCHIP_IMMUTABLE,
|
||||
GPIOCHIP_IRQ_RESOURCE_HELPERS,
|
||||
};
|
||||
|
||||
static irqreturn_t grgpio_irq_handler(int irq, void *dev)
|
||||
|
|
Loading…
Add table
Reference in a new issue