gpio: omap: simplify omap_set_gpio_irqenable()
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 10 Jun 2019 17:10:57 +0000 (20:10 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 12 Jun 2019 09:14:36 +0000 (11:14 +0200)
commit31b2d7f7cc07b60e0ff6aa31192a694ea36795e8
tree4f70b0c68c7884e6c6b0252cbe7639c498f1a937
parenta47b91587f6a05f2758dfa216c92d9dbc92528e7
gpio: omap: simplify omap_set_gpio_irqenable()

omap_set_gpio_irqenable() calls two helpers that are almost the same
apart from whether they set or clear bits. We can consolidate these:

- in the set/clear bit register case, we can perform the operation on
  our saved context copy and write the appropriate set/clear register.
- otherwise, we can use our read-modify-write helper and invert enable
  if irqenable_inv is set.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-omap.c