gpio: pisosr: add missing unlock
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 19 Feb 2016 09:23:00 +0000 (14:53 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 19 Feb 2016 11:56:13 +0000 (12:56 +0100)
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>
drivers/gpio/gpio-pisosr.c

index 58ea08dfdfce1d756db6a630b6b702d802d8e545..f9f1074744ab21bc23565ea49bfaca29d0486ab9 100644 (file)
@@ -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,