aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/gpio.c11
-rw-r--r--drivers/of/platform.c4
2 files changed, 8 insertions, 7 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:
78EXPORT_SYMBOL(of_get_named_gpio_flags); 78EXPORT_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 */
96unsigned int of_gpio_count(struct device_node *np) 97unsigned 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}
112EXPORT_SYMBOL(of_gpio_count); 113EXPORT_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 */
231static int of_gpiochip_is_match(struct gpio_chip *chip, void *data) 232static 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}
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 63b3ec48c203..20fbebd49db3 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
55#include <asm/dcr.h> 55#include <asm/dcr.h>
56#endif 56#endif
57 57
58#if !defined(CONFIG_SPARC) 58#ifdef CONFIG_OF_ADDRESS
59/* 59/*
60 * The following routines scan a subtree and registers a device for 60 * The following routines scan a subtree and registers a device for
61 * each applicable node. 61 * each applicable node.
@@ -462,4 +462,4 @@ int of_platform_populate(struct device_node *root,
462 of_node_put(root); 462 of_node_put(root);
463 return rc; 463 return rc;
464} 464}
465#endif /* !CONFIG_SPARC */ 465#endif /* CONFIG_OF_ADDRESS */