Skip to content

Commit 7633fb9

Browse files
committed
gpio: set data first, then chip and handler
During irq mapping, in irq_set_chip_and_handler() the process of setting this up may incur calls to lock the irqchip, which in turn may need to dereference and use the chip data. So set the data first, then set the chip and handler. Signed-off-by: Linus Walleij <[email protected]>
1 parent c9eaa44 commit 7633fb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpiolib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,8 +1387,8 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
13871387
{
13881388
struct gpio_chip *chip = d->host_data;
13891389

1390-
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
13911390
irq_set_chip_data(irq, chip);
1391+
irq_set_chip_and_handler(irq, chip->irqchip, chip->irq_handler);
13921392
#ifdef CONFIG_ARM
13931393
set_irq_flags(irq, IRQF_VALID);
13941394
#else

0 commit comments

Comments
 (0)