diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-15 17:15:29 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-04-17 13:30:06 +0300 |
commit | 48ce805683461f0205e5b1baa2385a0cb425388e (patch) | |
tree | 243ede0bfbca3c6c9d250371dee13f529f5ab319 /drivers/gpio/gpio-dwapb.c | |
parent | d31275a9dc0baa6b084917f8d42f1e197239fe6c (diff) | |
download | linux-48ce805683461f0205e5b1baa2385a0cb425388e.tar.xz |
gpio: dwapb: Switch to more usual pattern of RMW in dwapb_gpio_set_debounce()
More usual pattern is to prepare value and then write it in a single place.
Switch code in dwapb_gpio_set_debounce() to it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20200415141534.31240-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-dwapb.c')
-rw-r--r-- | drivers/gpio/gpio-dwapb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 4edac592c253..0b073cbc003b 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -327,9 +327,10 @@ static int dwapb_gpio_set_debounce(struct gpio_chip *gc, val_deb = dwapb_read(gpio, GPIO_PORTA_DEBOUNCE); if (debounce) - dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb | mask); + val_deb |= mask; else - dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb & ~mask); + val_deb &= ~mask; + dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb); spin_unlock_irqrestore(&gc->bgpio_lock, flags); |