]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/gpio/gpiolib.c
Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
[mv-sheeva.git] / drivers / gpio / gpiolib.c
index 83cbc34e3a763a79559f1a15b2f8a104243a81fd..6a6bd569e1f8c80851a553b9a4b1c98a76de9faa 100644 (file)
@@ -894,10 +894,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low);
 void gpio_unexport(unsigned gpio)
 {
        struct gpio_desc        *desc;
-       int                     status = -EINVAL;
+       int                     status = 0;
 
-       if (!gpio_is_valid(gpio))
+       if (!gpio_is_valid(gpio)) {
+               status = -EINVAL;
                goto done;
+       }
 
        mutex_lock(&sysfs_lock);
 
@@ -912,7 +914,6 @@ void gpio_unexport(unsigned gpio)
                        clear_bit(FLAG_EXPORT, &desc->flags);
                        put_device(dev);
                        device_unregister(dev);
-                       status = 0;
                } else
                        status = -ENODEV;
        }