gpio/starfive: redundant readl() call
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 29 Sep 2023 21:53:55 +0000 (23:53 +0200)
committerAnup Patel <anup@brainfault.org>
Fri, 6 Oct 2023 11:59:09 +0000 (17:29 +0530)
In starfive_gpio_direction_output() readl() is called twice to read the
gpio direction register. The result of the first read is discarded.

Remove the redundant read.

Fixes: 908be1b85c8f ("gpio/starfive: add gpio driver and support gpio reset")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/utils/gpio/fdt_gpio_starfive.c

index f430b1352c92f8f87ab6d949c2b67e477b9862f5..bd2a9f214aa60e623ca552bebbec0c5e46f37af9 100644 (file)
@@ -37,7 +37,6 @@ static int starfive_gpio_direction_output(struct gpio_pin *gp, int value)
        reg_addr = chip->addr + gp->offset;
        reg_addr &= ~(STARFIVE_GPIO_REG_SHIFT_MASK);
 
-       val = readl((void *)(reg_addr));
        shift_bits = (gp->offset & STARFIVE_GPIO_REG_SHIFT_MASK)
                << STARFIVE_GPIO_SHIFT_BITS;
        bit_mask = STARFIVE_GPIO_MASK << shift_bits;