Merge branch 'ib-gpiod-flags' into devel
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 5 Feb 2017 22:14:23 +0000 (23:14 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 5 Feb 2017 22:14:23 +0000 (23:14 +0100)
1  2 
drivers/gpio/devres.c
drivers/gpio/gpiolib.c

index d196be7ac352f0e9e4a4782a82c4a9c9cb185240,b2bbcaae6a1fe2f08e2a60deb48a53856eb82271..7031eea165c98586fa355547c25157a099823d9c
@@@ -137,12 -137,13 +139,12 @@@ EXPORT_SYMBOL(devm_gpiod_get_index)
   * On successfull request the GPIO pin is configured in accordance with
   * provided @flags.
   */
- struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
-                                           const char *con_id,
-                                           struct fwnode_handle *child,
-                                           enum gpiod_flags flags,
-                                           const char *label)
+ struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
+                                               const char *con_id, int index,
+                                               struct fwnode_handle *child,
+                                               enum gpiod_flags flags,
+                                               const char *label)
  {
 -      static const char * const suffixes[] = { "gpios", "gpio" };
        char prop_name[32]; /* 32 is max size of property name */
        struct gpio_desc **dr;
        struct gpio_desc *desc;
        if (!dr)
                return ERR_PTR(-ENOMEM);
  
 -      for (i = 0; i < ARRAY_SIZE(suffixes); i++) {
 +      for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
                if (con_id)
                        snprintf(prop_name, sizeof(prop_name), "%s-%s",
 -                                          con_id, suffixes[i]);
 +                                          con_id, gpio_suffixes[i]);
                else
                        snprintf(prop_name, sizeof(prop_name), "%s",
 -                                                             suffixes[i]);
 +                                          gpio_suffixes[i]);
  
-               desc = fwnode_get_named_gpiod(child, prop_name, flags, label);
+               desc = fwnode_get_named_gpiod(child, prop_name, index, flags,
+                                             label);
                if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
                        break;
        }
Simple merge