]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: tpic2810: Make sure cached buffer has consistent status with h/w status
authorAxel Lin <axel.lin@ingics.com>
Wed, 23 Mar 2016 11:49:41 +0000 (19:49 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 31 Mar 2016 13:14:37 +0000 (15:14 +0200)
commit135f48d609e043130f5b7989a69efca3cdeea142
treec91ccdb0443c7e07a3f207eb56cf730da31ca27d
parentb4e3c91b2238e40718802825171cbab136f4b5b2
gpio: tpic2810: Make sure cached buffer has consistent status with h/w status

i2c_smbus_write_byte_data() can fail. To ensure the
cached buffer has consistent status with h/w status, don't
update the cached gpio->buffer if write fails.

Also refactor the code a bit by adding a tpic2810_set_mask_bits()
helper and use it to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-tpic2810.c