mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
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: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
c8690d6d29
commit
fe4315c3b0
1 changed files with 2 additions and 1 deletions
|
|
@ -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(®s->inen) & ~(1 << offset), ®s->inen);
|
||||
adi_gpio_set_value(chip, offset, value);
|
||||
writew(1 << offset, ®s->dir_set);
|
||||
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue