diff options
Diffstat (limited to 'drivers/of/gpio.c')
-rw-r--r-- | drivers/of/gpio.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c index 7e62d15d60f6..bba81216b4db 100644 --- a/drivers/of/gpio.c +++ b/drivers/of/gpio.c | |||
@@ -78,8 +78,9 @@ err0: | |||
78 | EXPORT_SYMBOL(of_get_named_gpio_flags); | 78 | EXPORT_SYMBOL(of_get_named_gpio_flags); |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * of_gpio_count - Count GPIOs for a device | 81 | * of_gpio_named_count - Count GPIOs for a device |
82 | * @np: device node to count GPIOs for | 82 | * @np: device node to count GPIOs for |
83 | * @propname: property name containing gpio specifier(s) | ||
83 | * | 84 | * |
84 | * The function returns the count of GPIOs specified for a node. | 85 | * The function returns the count of GPIOs specified for a node. |
85 | * | 86 | * |
@@ -93,14 +94,14 @@ EXPORT_SYMBOL(of_get_named_gpio_flags); | |||
93 | * defines four GPIOs (so this function will return 4), two of which | 94 | * defines four GPIOs (so this function will return 4), two of which |
94 | * are not specified. | 95 | * are not specified. |
95 | */ | 96 | */ |
96 | unsigned int of_gpio_count(struct device_node *np) | 97 | unsigned int of_gpio_named_count(struct device_node *np, const char* propname) |
97 | { | 98 | { |
98 | unsigned int cnt = 0; | 99 | unsigned int cnt = 0; |
99 | 100 | ||
100 | do { | 101 | do { |
101 | int ret; | 102 | int ret; |
102 | 103 | ||
103 | ret = of_parse_phandle_with_args(np, "gpios", "#gpio-cells", | 104 | ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", |
104 | cnt, NULL); | 105 | cnt, NULL); |
105 | /* A hole in the gpios = <> counts anyway. */ | 106 | /* A hole in the gpios = <> counts anyway. */ |
106 | if (ret < 0 && ret != -EEXIST) | 107 | if (ret < 0 && ret != -EEXIST) |
@@ -109,7 +110,7 @@ unsigned int of_gpio_count(struct device_node *np) | |||
109 | 110 | ||
110 | return cnt; | 111 | return cnt; |
111 | } | 112 | } |
112 | EXPORT_SYMBOL(of_gpio_count); | 113 | EXPORT_SYMBOL(of_gpio_named_count); |
113 | 114 | ||
114 | /** | 115 | /** |
115 | * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags | 116 | * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags |
@@ -228,7 +229,7 @@ void of_gpiochip_remove(struct gpio_chip *chip) | |||
228 | } | 229 | } |
229 | 230 | ||
230 | /* Private function for resolving node pointer to gpio_chip */ | 231 | /* Private function for resolving node pointer to gpio_chip */ |
231 | static int of_gpiochip_is_match(struct gpio_chip *chip, void *data) | 232 | static int of_gpiochip_is_match(struct gpio_chip *chip, const void *data) |
232 | { | 233 | { |
233 | return chip->of_node == data; | 234 | return chip->of_node == data; |
234 | } | 235 | } |