diff options
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r-- | drivers/gpio/gpiolib-of.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index d542a141811a..a71a54a3e3f7 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
@@ -89,41 +89,6 @@ int of_get_named_gpio_flags(struct device_node *np, const char *propname, | |||
89 | EXPORT_SYMBOL(of_get_named_gpio_flags); | 89 | EXPORT_SYMBOL(of_get_named_gpio_flags); |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * of_gpio_named_count - Count GPIOs for a device | ||
93 | * @np: device node to count GPIOs for | ||
94 | * @propname: property name containing gpio specifier(s) | ||
95 | * | ||
96 | * The function returns the count of GPIOs specified for a node. | ||
97 | * | ||
98 | * Note that the empty GPIO specifiers counts too. For example, | ||
99 | * | ||
100 | * gpios = <0 | ||
101 | * &pio1 1 2 | ||
102 | * 0 | ||
103 | * &pio2 3 4>; | ||
104 | * | ||
105 | * defines four GPIOs (so this function will return 4), two of which | ||
106 | * are not specified. | ||
107 | */ | ||
108 | unsigned int of_gpio_named_count(struct device_node *np, const char* propname) | ||
109 | { | ||
110 | unsigned int cnt = 0; | ||
111 | |||
112 | do { | ||
113 | int ret; | ||
114 | |||
115 | ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", | ||
116 | cnt, NULL); | ||
117 | /* A hole in the gpios = <> counts anyway. */ | ||
118 | if (ret < 0 && ret != -EEXIST) | ||
119 | break; | ||
120 | } while (++cnt); | ||
121 | |||
122 | return cnt; | ||
123 | } | ||
124 | EXPORT_SYMBOL(of_gpio_named_count); | ||
125 | |||
126 | /** | ||
127 | * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags | 92 | * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags |
128 | * @gc: pointer to the gpio_chip structure | 93 | * @gc: pointer to the gpio_chip structure |
129 | * @np: device node of the GPIO chip | 94 | * @np: device node of the GPIO chip |
@@ -250,7 +215,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) | |||
250 | * on the same GPIO chip. | 215 | * on the same GPIO chip. |
251 | */ | 216 | */ |
252 | ret = gpiochip_add_pin_range(chip, | 217 | ret = gpiochip_add_pin_range(chip, |
253 | pinctrl_dev_get_name(pctldev), | 218 | pinctrl_dev_get_devname(pctldev), |
254 | 0, /* offset in gpiochip */ | 219 | 0, /* offset in gpiochip */ |
255 | pinspec.args[0], | 220 | pinspec.args[0], |
256 | pinspec.args[1]); | 221 | pinspec.args[1]); |