diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-09-24 03:47:41 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-09-27 08:19:59 -0400 |
commit | fe4315c3b0cbd4ae5a0b7fcf42c265ed03e27d7a (patch) | |
tree | 61f38c653c217ab1bc930d1a15f29bb57348b0ac /drivers/pinctrl | |
parent | c8690d6d2957ed060c1cba4cde3ec41e3829651b (diff) |
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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-adi2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c index f2aa8773f4e3..8089fda00427 100644 --- a/drivers/pinctrl/pinctrl-adi2.c +++ b/drivers/pinctrl/pinctrl-adi2.c | |||
@@ -776,10 +776,11 @@ static int adi_gpio_direction_output(struct gpio_chip *chip, unsigned offset, | |||
776 | struct gpio_port_t *regs = port->regs; | 776 | struct gpio_port_t *regs = port->regs; |
777 | unsigned long flags; | 777 | unsigned long flags; |
778 | 778 | ||
779 | adi_gpio_set_value(chip, offset, value); | ||
780 | |||
779 | spin_lock_irqsave(&port->lock, flags); | 781 | spin_lock_irqsave(&port->lock, flags); |
780 | 782 | ||
781 | writew(readw(®s->inen) & ~(1 << offset), ®s->inen); | 783 | writew(readw(®s->inen) & ~(1 << offset), ®s->inen); |
782 | adi_gpio_set_value(chip, offset, value); | ||
783 | writew(1 << offset, ®s->dir_set); | 784 | writew(1 << offset, ®s->dir_set); |
784 | 785 | ||
785 | spin_unlock_irqrestore(&port->lock, flags); | 786 | spin_unlock_irqrestore(&port->lock, flags); |