Skip to content

Commit 7688a54

Browse files
MrVanBartosz Golaszewski
authored andcommitted
gpio: mpc8xxx: Make irq_chip immutable
Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" 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 289e42d commit 7688a54

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpio/gpio-mpc8xxx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,12 @@ static irqreturn_t mpc8xxx_gpio_irq_cascade(int irq, void *data)
123123
static void mpc8xxx_irq_unmask(struct irq_data *d)
124124
{
125125
struct mpc8xxx_gpio_chip *mpc8xxx_gc = irq_data_get_irq_chip_data(d);
126+
irq_hw_number_t hwirq = irqd_to_hwirq(d);
126127
struct gpio_chip *gc = &mpc8xxx_gc->gc;
127128
unsigned long flags;
128129

130+
gpiochip_enable_irq(gc, hwirq);
131+
129132
raw_spin_lock_irqsave(&mpc8xxx_gc->lock, flags);
130133

131134
gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR,
@@ -138,6 +141,7 @@ static void mpc8xxx_irq_unmask(struct irq_data *d)
138141
static void mpc8xxx_irq_mask(struct irq_data *d)
139142
{
140143
struct mpc8xxx_gpio_chip *mpc8xxx_gc = irq_data_get_irq_chip_data(d);
144+
irq_hw_number_t hwirq = irqd_to_hwirq(d);
141145
struct gpio_chip *gc = &mpc8xxx_gc->gc;
142146
unsigned long flags;
143147

@@ -148,6 +152,8 @@ static void mpc8xxx_irq_mask(struct irq_data *d)
148152
& ~mpc_pin2mask(irqd_to_hwirq(d)));
149153

150154
raw_spin_unlock_irqrestore(&mpc8xxx_gc->lock, flags);
155+
156+
gpiochip_disable_irq(gc, hwirq);
151157
}
152158

153159
static void mpc8xxx_irq_ack(struct irq_data *d)
@@ -244,6 +250,8 @@ static struct irq_chip mpc8xxx_irq_chip = {
244250
.irq_ack = mpc8xxx_irq_ack,
245251
/* this might get overwritten in mpc8xxx_probe() */
246252
.irq_set_type = mpc8xxx_irq_set_type,
253+
.flags = IRQCHIP_IMMUTABLE,
254+
GPIOCHIP_IRQ_RESOURCE_HELPERS,
247255
};
248256

249257
static int mpc8xxx_gpio_irq_map(struct irq_domain *h, unsigned int irq,

0 commit comments

Comments
 (0)