summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/devres.c
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2017-01-12 11:39:24 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-01-26 03:59:52 -0500
commitb2987d7438e0ca949d81774ca8b43d370a1f9947 (patch)
tree21fb2c0cfb36fed138bc1660e0de75cb017c9b13 /drivers/gpio/devres.c
parenta264d10ff45c688293d9112fddd8d29c819e0853 (diff)
gpio: Pass GPIO label down to gpiod_request
Currently all users of fwnode_get_named_gpiod() have no way to specify a label for the GPIO. So GPIOs listed in debugfs are shown with label "?". With this change a proper label is used. Also adjust all users so they can pass a label, properly retrieved from device tree properties. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/devres.c')
-rw-r--r--drivers/gpio/devres.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 5e0b41b5e554..89969e887e5d 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -138,7 +138,8 @@ EXPORT_SYMBOL(devm_gpiod_get_index);
138struct gpio_desc *devm_get_gpiod_from_child(struct device *dev, 138struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
139 const char *con_id, 139 const char *con_id,
140 struct fwnode_handle *child, 140 struct fwnode_handle *child,
141 enum gpiod_flags flags) 141 enum gpiod_flags flags,
142 const char *label)
142{ 143{
143 static const char * const suffixes[] = { "gpios", "gpio" }; 144 static const char * const suffixes[] = { "gpios", "gpio" };
144 char prop_name[32]; /* 32 is max size of property name */ 145 char prop_name[32]; /* 32 is max size of property name */
@@ -159,7 +160,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
159 snprintf(prop_name, sizeof(prop_name), "%s", 160 snprintf(prop_name, sizeof(prop_name), "%s",
160 suffixes[i]); 161 suffixes[i]);
161 162
162 desc = fwnode_get_named_gpiod(child, prop_name, flags); 163 desc = fwnode_get_named_gpiod(child, prop_name, flags, label);
163 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT)) 164 if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
164 break; 165 break;
165 } 166 }