gpio: pca953x: Fix corruption of other gpios in set_multiple.
authorPhil Reid <preid@electromag.com.au>
Tue, 8 Nov 2016 06:00:45 +0000 (14:00 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 8 Nov 2016 09:29:42 +0000 (10:29 +0100)
commit53f8d322234649b4d6f1515b20c127a577efd164
treea0a415504e0fae15c37a4ef7473f9ddeb9cad716
parentbc33b0ca11e3df467777a4fa7639ba488c9d4911
gpio: pca953x: Fix corruption of other gpios in set_multiple.

gpiod_set_array_value_complex does not clear the bits field.
Therefore when the drivers set_multiple funciton is called bits outside
the mask are undefined and can be either set or not. So bank_val needs
to be masked with bank_mask before or with the reg_val cache.

Cc: stable@vger.kernel.org
Fixes: b4818afeacbd ("gpio: pca953x: Add set_multiple to allow multiple")
Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pca953x.c