diff options
author | Sergio Paracuellos <sergio.paracuellos@gmail.com> | 2018-05-25 12:54:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-01 05:17:05 -0400 |
commit | 7efcce04309260e8088e89ca2c0a33cff452ac5c (patch) | |
tree | 7aec3ef2f099c72ee211ee52ca073eef7c514f46 | |
parent | e119216dea2dd7c78e231c06b9822072bb4a553e (diff) |
staging: mt7621-gpio: avoid locking in mediatek_gpio_get_direction
mediatek_gpio_get_direction function is holding across a simple read
which it seems to be not neccessary at all. Just remove this locking
cleaning code of this function a bit.
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 | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c index 79452eb7a654..143268a866c2 100644 --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c | |||
@@ -129,12 +129,7 @@ static int | |||
129 | mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) | 129 | mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) |
130 | { | 130 | { |
131 | struct mtk_gc *rg = to_mediatek_gpio(chip); | 131 | struct mtk_gc *rg = to_mediatek_gpio(chip); |
132 | unsigned long flags; | 132 | u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL); |
133 | u32 t; | ||
134 | |||
135 | spin_lock_irqsave(&rg->lock, flags); | ||
136 | t = mtk_gpio_r32(rg, GPIO_REG_CTRL); | ||
137 | spin_unlock_irqrestore(&rg->lock, flags); | ||
138 | 133 | ||
139 | return (t & BIT(offset)) ? 0 : 1; | 134 | return (t & BIT(offset)) ? 0 : 1; |
140 | } | 135 | } |