mfd: Rely on regmap cache in wm8350 interrupt controller
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 3 Jun 2012 12:37:23 +0000 (13:37 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 8 Jul 2012 22:16:10 +0000 (00:16 +0200)
We can just use regmap_update_bits() to achieve the same effect - it will
do the read/modify/update cycle for us.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/wm8350-irq.c

index 9fd01bf63c510eafab2c1efc987728576aa54f5e..624ff90501cde3c5fdf1e79f026db8cfa321eb37 100644 (file)
@@ -432,11 +432,9 @@ static void wm8350_irq_sync_unlock(struct irq_data *data)
        for (i = 0; i < ARRAY_SIZE(wm8350->irq_masks); i++) {
                /* If there's been a change in the mask write it back
                 * to the hardware. */
-               if (wm8350->irq_masks[i] !=
-                   wm8350->reg_cache[WM8350_INT_STATUS_1_MASK + i])
-                       WARN_ON(wm8350_reg_write(wm8350,
-                                        WM8350_INT_STATUS_1_MASK + i,
-                                                wm8350->irq_masks[i]));
+               WARN_ON(regmap_update_bits(wm8350->regmap,
+                                          WM8350_INT_STATUS_1_MASK + i,
+                                          0xffff, wm8350->irq_masks[i]));
        }
 
        mutex_unlock(&wm8350->irq_lock);