summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2016-02-19 14:53:00 +0530
committerLinus Walleij <linus.walleij@linaro.org>2016-02-19 12:56:13 +0100
commit3e089d9f55acfe9edd8a71d19cfc3129ab3a37f8 (patch)
tree231b18f919bc9448fb42ff6f085b0ec94487f9ea
parent8cae5f9740676a46c0b5eb35e60cd13c46b99bd0 (diff)
downloadop-kernel-dev-3e089d9f55acfe9edd8a71d19cfc3129ab3a37f8.zip
op-kernel-dev-3e089d9f55acfe9edd8a71d19cfc3129ab3a37f8.tar.gz
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>
-rw-r--r--drivers/gpio/gpio-pisosr.c4
1 files changed, 1 insertions, 3 deletions
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 @@ static int pisosr_gpio_refresh(struct pisosr_gpio *gpio)
}
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,
OpenPOWER on IntegriCloud