mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 22:02:28 +00:00
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>
This commit is contained in:
parent
d31275a9dc
commit
48ce805683
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user