Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24d6b36e authored by Laurent Pinchart's avatar Laurent Pinchart
Browse files

sh-pfc: Don't needlessly check GPIO type in sh_gpio_free()



The GPIO type is always PINMUX_TYPE_FUNCTION when freeing a function
GPIO. Hardcode the type value.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2119f7c9
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -71,16 +71,13 @@ static void sh_gpio_free(struct gpio_chip *gc, unsigned offset)
{
	struct sh_pfc *pfc = gpio_to_pfc(gc);
	unsigned long flags;
	int pinmux_type;

	if (offset < pfc->info->nr_pins)
		return pinctrl_free_gpio(offset);

	spin_lock_irqsave(&pfc->lock, flags);

	pinmux_type = pfc->info->gpios[offset].flags & PINMUX_FLAG_TYPE;

	sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE);
	sh_pfc_config_gpio(pfc, offset, PINMUX_TYPE_FUNCTION, GPIO_CFG_FREE);

	spin_unlock_irqrestore(&pfc->lock, flags);
}