Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Set da903x bits if new value is different from the old one

It does not make sense to write new value only when all the bit_mask
bits are zero.
We need to write new value if the bit mask fields of new value is
not equal to old value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Axel Lin and committed by
Samuel Ortiz
af65e6ce 890c98e3

+1 -1
+1 -1
drivers/mfd/da903x.c
··· 182 182 if (ret) 183 183 goto out; 184 184 185 - if ((reg_val & bit_mask) == 0) { 185 + if ((reg_val & bit_mask) != bit_mask) { 186 186 reg_val |= bit_mask; 187 187 ret = __da903x_write(chip->client, reg, reg_val); 188 188 }