aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e27877ad0163..e14eb88bbe8d 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -212,13 +212,14 @@ static ssize_t gpio_direction_show(struct device *dev,
212 212
213 mutex_lock(&sysfs_lock); 213 mutex_lock(&sysfs_lock);
214 214
215 if (!test_bit(FLAG_EXPORT, &desc->flags)) 215 if (!test_bit(FLAG_EXPORT, &desc->flags)) {
216 status = -EIO; 216 status = -EIO;
217 else 217 } else {
218 gpio_get_direction(gpio); 218 gpio_get_direction(gpio);
219 status = sprintf(buf, "%s\n", 219 status = sprintf(buf, "%s\n",
220 test_bit(FLAG_IS_OUT, &desc->flags) 220 test_bit(FLAG_IS_OUT, &desc->flags)
221 ? "out" : "in"); 221 ? "out" : "in");
222 }
222 223
223 mutex_unlock(&sysfs_lock); 224 mutex_unlock(&sysfs_lock);
224 return status; 225 return status;