staging: mt7621-gpio: avoid locking in mediatek_gpio_get_direction
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Fri, 25 May 2018 16:54:50 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2018 09:17:05 +0000 (11:17 +0200)
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>
drivers/staging/mt7621-gpio/gpio-mt7621.c

index 79452eb7a654379daae87a5bd3e4e0d89021b858..143268a866c24d5cc975fa8cdd483b5b40403a66 100644 (file)
@@ -129,12 +129,7 @@ static int
 mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
 {
        struct mtk_gc *rg = to_mediatek_gpio(chip);
-       unsigned long flags;
-       u32 t;
-
-       spin_lock_irqsave(&rg->lock, flags);
-       t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
-       spin_unlock_irqrestore(&rg->lock, flags);
+       u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
 
        return (t & BIT(offset)) ? 0 : 1;
 }