aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 83cbc34e3a76..6a6bd569e1f8 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -894,10 +894,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low);
894void gpio_unexport(unsigned gpio) 894void gpio_unexport(unsigned gpio)
895{ 895{
896 struct gpio_desc *desc; 896 struct gpio_desc *desc;
897 int status = -EINVAL; 897 int status = 0;
898 898
899 if (!gpio_is_valid(gpio)) 899 if (!gpio_is_valid(gpio)) {
900 status = -EINVAL;
900 goto done; 901 goto done;
902 }
901 903
902 mutex_lock(&sysfs_lock); 904 mutex_lock(&sysfs_lock);
903 905
@@ -912,7 +914,6 @@ void gpio_unexport(unsigned gpio)
912 clear_bit(FLAG_EXPORT, &desc->flags); 914 clear_bit(FLAG_EXPORT, &desc->flags);
913 put_device(dev); 915 put_device(dev);
914 device_unregister(dev); 916 device_unregister(dev);
915 status = 0;
916 } else 917 } else
917 status = -ENODEV; 918 status = -ENODEV;
918 } 919 }