On Mon, Jan 15, 2018 at 07:47:28PM +0100, Lukas Wunner wrote: > On Fri, Oct 20, 2017 at 05:10:30PM +0200, Linus Walleij wrote: > Third, I think we need to initialize *bits = 0 in case it contains > garbage. Scratch that, it's the other way 'round, I remember now that in max3191x_get_multiple() I deliberately only touched the bits in *bits that are also set in *mask. However there's another bug then: bgpio_get_multiple() touches bits in *bits not set in *mask because it outright assigns a value to *bits. This should be something like: *bits &= ~*mask; *bits |= gc->read_reg(gc->reg_dat) & *mask; And bgpio_get_set_multiple() only ORs bits to *bits but never clears it. That's wrong, you need to AND with the inverse of *mask first, see above. bgpio_get_multiple_be() has the same problem. Thanks, Lukas -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html