Commit fe4315c3 authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij

pinctrl: adi2: Fix dead lock in adi_gpio_direction_output

Current code hold port->lock spinlock and then try to grab the lock again
in adi_gpio_set_value(). Fix it.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent c8690d6d
......@@ -776,10 +776,11 @@ static int adi_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
struct gpio_port_t *regs = port->regs;
unsigned long flags;
adi_gpio_set_value(chip, offset, value);
spin_lock_irqsave(&port->lock, flags);
writew(readw(&regs->inen) & ~(1 << offset), &regs->inen);
adi_gpio_set_value(chip, offset, value);
writew(1 << offset, &regs->dir_set);
spin_unlock_irqrestore(&port->lock, flags);
......
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