mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
gpio: viperboard: Unlock on error in vprbrd_gpiob_direction_output()
Unlock before returning if vprbrd_gpiob_setdir() fails.
Fixes: 55e2d1eec1 ("gpio: viperboard: use new GPIO line value setter callbacks")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/9e72018c-e46e-4e55-83e4-503da4d022fc@sabinyo.mountain
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
0c0438d444
commit
5103fbb7b5
|
|
@ -378,15 +378,13 @@ static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
|
|||
gpio->gpiob_out |= (1 << offset);
|
||||
|
||||
mutex_lock(&vb->lock);
|
||||
|
||||
ret = vprbrd_gpiob_setdir(vb, offset, 1);
|
||||
mutex_unlock(&vb->lock);
|
||||
if (ret) {
|
||||
dev_err(chip->parent, "usb error setting pin to output\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
mutex_unlock(&vb->lock);
|
||||
|
||||
return vprbrd_gpiob_set(chip, offset, value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user