Merge tag 'gpio-updates-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / drivers / gpio / gpio-pca953x.c
index 81d9c211370716da0e5fd2c07048f3e2c51c80a7..b444c6ab958bfd0681fda824ee0b76109d83f78c 100644 (file)
@@ -784,11 +784,11 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pendin
        bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio);
        bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio);
 
+       bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
+
        if (bitmap_empty(trigger, gc->ngpio))
                return false;
 
-       bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
-
        bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio);
        bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio);
        bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio);