Merge tag 'hda-switcheroo' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[deliverable/linux.git] / drivers / gpio / gpiolib.c
index 5a75510d66bb14a2148c71432104fc7ac5f39d9b..120b2a0e3167fd7a8210fbbb8e86ee336ea7efc5 100644 (file)
@@ -1093,7 +1093,7 @@ unlock:
        if (status)
                goto fail;
 
-       pr_info("gpiochip_add: registered GPIOs %d to %d on device: %s\n",
+       pr_debug("gpiochip_add: registered GPIOs %d to %d on device: %s\n",
                chip->base, chip->base + chip->ngpio - 1,
                chip->label ? : "generic");
 
@@ -1154,9 +1154,9 @@ EXPORT_SYMBOL_GPL(gpiochip_remove);
  * non-zero, this function will return to the caller and not iterate over any
  * more gpio_chips.
  */
-struct gpio_chip *gpiochip_find(const void *data,
+struct gpio_chip *gpiochip_find(void *data,
                                int (*match)(struct gpio_chip *chip,
-                                            const void *data))
+                                            void *data))
 {
        struct gpio_chip *chip = NULL;
        unsigned long flags;
@@ -1302,8 +1302,18 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
                                (flags & GPIOF_INIT_HIGH) ? 1 : 0);
 
        if (err)
-               gpio_free(gpio);
+               goto free_gpio;
+
+       if (flags & GPIOF_EXPORT) {
+               err = gpio_export(gpio, flags & GPIOF_EXPORT_CHANGEABLE);
+               if (err)
+                       goto free_gpio;
+       }
+
+       return 0;
 
+ free_gpio:
+       gpio_free(gpio);
        return err;
 }
 EXPORT_SYMBOL_GPL(gpio_request_one);
This page took 0.027443 seconds and 5 git commands to generate.