diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2018-05-20 09:00:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-25 12:49:32 -0400 |
commit | b36dd3af48f65c0e498d62bb5e6c388b03f77608 (patch) | |
tree | e525c3b58352df3928c345dc83484464502253ac | |
parent | e9301a5a8b6bc5097c76d12c1f07f8a6456bc341 (diff) |
staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction
This commits replaces if statement and two returns in favour
of a only one return using a ternary operator.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/mt7621-gpio/gpio-mt7621.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c index bbe6cce56d90..15a1003017f8 100644 --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c | |||
@@ -135,10 +135,7 @@ mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) | |||
135 | t = mtk_gpio_r32(rg, GPIO_REG_CTRL); | 135 | t = mtk_gpio_r32(rg, GPIO_REG_CTRL); |
136 | spin_unlock_irqrestore(&rg->lock, flags); | 136 | spin_unlock_irqrestore(&rg->lock, flags); |
137 | 137 | ||
138 | if (t & BIT(offset)) | 138 | return (t & BIT(offset)) ? 0 : 1; |
139 | return 0; | ||
140 | |||
141 | return 1; | ||
142 | } | 139 | } |
143 | 140 | ||
144 | static int | 141 | static int |