diff options
author | Alexander Stein <alexander.stein@systec-electronic.com> | 2017-01-12 19:39:24 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-26 11:59:52 +0300 |
commit | b2987d7438e0ca949d81774ca8b43d370a1f9947 (patch) | |
tree | 21fb2c0cfb36fed138bc1660e0de75cb017c9b13 /drivers/gpio/devres.c | |
parent | a264d10ff45c688293d9112fddd8d29c819e0853 (diff) | |
download | 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/devres.c')
-rw-r--r-- | drivers/gpio/devres.c | 5 |
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); 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; } |