Skip to content

Commit 580b326

Browse files
MrVanBartosz Golaszewski
authored andcommitted
gpio: xgene-sb: Make irq_chip immutable
Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Constify xgene_gpio_sb_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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 3f50bb3 commit 580b326

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

drivers/gpio/gpio-xgene-sb.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,32 @@ static int xgene_gpio_sb_irq_set_type(struct irq_data *d, unsigned int type)
103103
return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH);
104104
}
105105

106-
static struct irq_chip xgene_gpio_sb_irq_chip = {
106+
static void xgene_gpio_sb_irq_mask(struct irq_data *d)
107+
{
108+
struct xgene_gpio_sb *priv = irq_data_get_irq_chip_data(d);
109+
110+
irq_chip_mask_parent(d);
111+
112+
gpiochip_disable_irq(&priv->gc, d->hwirq);
113+
}
114+
115+
static void xgene_gpio_sb_irq_unmask(struct irq_data *d)
116+
{
117+
struct xgene_gpio_sb *priv = irq_data_get_irq_chip_data(d);
118+
119+
gpiochip_enable_irq(&priv->gc, d->hwirq);
120+
121+
irq_chip_unmask_parent(d);
122+
}
123+
124+
static const struct irq_chip xgene_gpio_sb_irq_chip = {
107125
.name = "sbgpio",
108126
.irq_eoi = irq_chip_eoi_parent,
109-
.irq_mask = irq_chip_mask_parent,
110-
.irq_unmask = irq_chip_unmask_parent,
127+
.irq_mask = xgene_gpio_sb_irq_mask,
128+
.irq_unmask = xgene_gpio_sb_irq_unmask,
111129
.irq_set_type = xgene_gpio_sb_irq_set_type,
130+
.flags = IRQCHIP_IMMUTABLE,
131+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
112132
};
113133

114134
static int xgene_gpio_sb_to_irq(struct gpio_chip *gc, u32 gpio)

0 commit comments

Comments
 (0)