OSDN Git Service

gpio: omap: simplify omap_toggle_gpio_edge_triggering()
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 10 Jun 2019 17:10:56 +0000 (20:10 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 12 Jun 2019 09:14:30 +0000 (11:14 +0200)
commita47b91587f6a05f2758dfa216c92d9dbc92528e7
treeab13f7de854c3c4376d8bd89512a09a673d1366f
parent8ee1de65a94b14427b5d5e3a7e7b81523451d4f2
gpio: omap: simplify omap_toggle_gpio_edge_triggering()

This function open-codes an exclusive-or bitwise operation using an
if() statement and explicitly setting or clearing the bit. Instead,
use an exclusive-or operation instead, and simplify the function.

We can combine the preprocessor conditional using IS_ENABLED() and
gain some additional compilation coverage.

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