On Mon, 2022-10-10 at 15:20 +0200, Levente Révész wrote: > @@ -1245,21 +1265,23 @@ static int pca953x_regcache_sync(struct > device *dev) > } > > #ifdef CONFIG_GPIO_PCA953X_IRQ > - if (chip->driver_data & PCA_PCAL) { > - regaddr = chip->recalc_addr(chip, PCAL953X_IN_LATCH, > 0); > + if (chip->driver_data & PCA_HAS_INT_MASK) { > + regaddr = pca953x_recalc_addr(chip, chip->regs- > >int_mask, 0); For consistency, this should probably continue using chip->recalc_addr(). Martyn > ret = regcache_sync_region(chip->regmap, regaddr, > regaddr + NBANK(chip) - > 1); > if (ret) { > - dev_err(dev, "Failed to sync INT latch > registers: %d\n", > + dev_err(dev, "Failed to sync INT mask > registers: %d\n", > ret); > return ret; > } > + } > > - regaddr = chip->recalc_addr(chip, PCAL953X_INT_MASK, > 0); > + if (chip->driver_data & PCA_PCAL) { > + regaddr = chip->recalc_addr(chip, PCAL953X_IN_LATCH, > 0); > ret = regcache_sync_region(chip->regmap, regaddr, > regaddr + NBANK(chip) - > 1); > if (ret) { > - dev_err(dev, "Failed to sync INT mask > registers: %d\n", > + dev_err(dev, "Failed to sync INT latch > registers: %d\n", > ret); > return ret; > }