Commit 7efcce04 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

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: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarNeilBrown <neil@brown.name>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e119216d
...@@ -129,12 +129,7 @@ static int ...@@ -129,12 +129,7 @@ static int
mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{ {
struct mtk_gc *rg = to_mediatek_gpio(chip); struct mtk_gc *rg = to_mediatek_gpio(chip);
unsigned long flags; u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
u32 t;
spin_lock_irqsave(&rg->lock, flags);
t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
spin_unlock_irqrestore(&rg->lock, flags);
return (t & BIT(offset)) ? 0 : 1; return (t & BIT(offset)) ? 0 : 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment