aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/gpio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c
index 905960338fb2..3007662ac614 100644
--- a/drivers/of/gpio.c
+++ b/drivers/of/gpio.c
@@ -21,8 +21,9 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22 22
23/** 23/**
24 * of_get_gpio_flags - Get a GPIO number and flags to use with GPIO API 24 * of_get_named_gpio_flags() - Get a GPIO number and flags to use with GPIO API
25 * @np: device node to get GPIO from 25 * @np: device node to get GPIO from
26 * @propname: property name containing gpio specifier(s)
26 * @index: index of the GPIO 27 * @index: index of the GPIO
27 * @flags: a flags pointer to fill in 28 * @flags: a flags pointer to fill in
28 * 29 *
@@ -30,8 +31,8 @@
30 * value on the error condition. If @flags is not NULL the function also fills 31 * value on the error condition. If @flags is not NULL the function also fills
31 * in flags for the GPIO. 32 * in flags for the GPIO.
32 */ 33 */
33int of_get_gpio_flags(struct device_node *np, int index, 34int of_get_named_gpio_flags(struct device_node *np, const char *propname,
34 enum of_gpio_flags *flags) 35 int index, enum of_gpio_flags *flags)
35{ 36{
36 int ret; 37 int ret;
37 struct device_node *gpio_np; 38 struct device_node *gpio_np;
@@ -40,7 +41,7 @@ int of_get_gpio_flags(struct device_node *np, int index,
40 const void *gpio_spec; 41 const void *gpio_spec;
41 const __be32 *gpio_cells; 42 const __be32 *gpio_cells;
42 43
43 ret = of_parse_phandles_with_args(np, "gpios", "#gpio-cells", index, 44 ret = of_parse_phandles_with_args(np, propname, "#gpio-cells", index,
44 &gpio_np, &gpio_spec); 45 &gpio_np, &gpio_spec);
45 if (ret) { 46 if (ret) {
46 pr_debug("%s: can't parse gpios property\n", __func__); 47 pr_debug("%s: can't parse gpios property\n", __func__);
@@ -79,7 +80,7 @@ err0:
79 pr_debug("%s exited with status %d\n", __func__, ret); 80 pr_debug("%s exited with status %d\n", __func__, ret);
80 return ret; 81 return ret;
81} 82}
82EXPORT_SYMBOL(of_get_gpio_flags); 83EXPORT_SYMBOL(of_get_named_gpio_flags);
83 84
84/** 85/**
85 * of_gpio_count - Count GPIOs for a device 86 * of_gpio_count - Count GPIOs for a device