Skip to content

Commit 8df89a7

Browse files
Hans Verkuillinusw
authored andcommitted
pinctrl-sunxi: don't call pinctrl_gpio_direction()
Set the direction directly without calling pinctrl_gpio_direction(). This avoids the mutex_lock() calls in that function, which would invalid the can_sleep = false. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Link: https://lore.kernel.org/r/20211206131648.1521868-4-hverkuil-cisco@xs4all.nl Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 1a4541b commit 8df89a7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/pinctrl/sunxi/pinctrl-sunxi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,9 @@ static const struct pinmux_ops sunxi_pmx_ops = {
835835
static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
836836
unsigned offset)
837837
{
838-
return pinctrl_gpio_direction_input(chip->base + offset);
838+
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
839+
840+
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, true);
839841
}
840842

841843
static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
@@ -885,8 +887,10 @@ static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
885887
static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
886888
unsigned offset, int value)
887889
{
890+
struct sunxi_pinctrl *pctl = gpiochip_get_data(chip);
891+
888892
sunxi_pinctrl_gpio_set(chip, offset, value);
889-
return pinctrl_gpio_direction_output(chip->base + offset);
893+
return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, false);
890894
}
891895

892896
static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,

0 commit comments

Comments
 (0)