gpio: pisosr: add missing unlock
If spi_read() fails then we just returned but we missed unlocking the
mutex.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c
index 58ea08d..f9f1074 100644
--- a/drivers/gpio/gpio-pisosr.c
+++ b/drivers/gpio/gpio-pisosr.c
@@ -53,12 +53,10 @@
}
ret = spi_read(gpio->spi, gpio->buffer, gpio->buffer_size);
- if (ret)
- return ret;
mutex_unlock(&gpio->lock);
- return 0;
+ return ret;
}
static int pisosr_gpio_get_direction(struct gpio_chip *chip,