summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2017-01-12 17:39:24 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-01-26 09:59:52 +0100
commitb2987d7438e0ca949d81774ca8b43d370a1f9947 (patch)
tree21fb2c0cfb36fed138bc1660e0de75cb017c9b13 /drivers/gpio
parenta264d10ff45c688293d9112fddd8d29c819e0853 (diff)
downloadlinux-b2987d7438e0ca949d81774ca8b43d370a1f9947.tar.gz
linux-b2987d7438e0ca949d81774ca8b43d370a1f9947.tar.xz
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')
-rw-r--r--drivers/gpio/devres.c5
-rw-r--r--drivers/gpio/gpiolib.c5
2 files changed, 6 insertions, 4 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);
struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
const char *con_id,
struct fwnode_handle *child,
- enum gpiod_flags flags)
+ 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 */
@@ -159,7 +160,7 @@ struct gpio_desc *devm_get_gpiod_from_child(struct device *dev,
snprintf(prop_name, sizeof(prop_name), "%s",
suffixes[i]);
- desc = fwnode_get_named_gpiod(child, prop_name, flags);
+ desc = fwnode_get_named_gpiod(child, prop_name, flags, label);
if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
break;
}
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index bb3d3a7edc45..20c6c51cbe10 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3325,7 +3325,8 @@ EXPORT_SYMBOL_GPL(gpiod_get_index);
*/
struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
const char *propname,
- enum gpiod_flags dflags)
+ enum gpiod_flags dflags,
+ const char *label)
{
struct gpio_desc *desc = ERR_PTR(-ENODEV);
unsigned long lflags = 0;
@@ -3356,7 +3357,7 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
if (IS_ERR(desc))
return desc;
- ret = gpiod_request(desc, NULL);
+ ret = gpiod_request(desc, label);
if (ret)
return ERR_PTR(ret);