diff options
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r-- | drivers/gpio/gpiolib-of.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index af7e25c9a9ae..604dbe60bdee 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/pinctrl/pinctrl.h> | 23 | #include <linux/pinctrl/pinctrl.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | 25 | ||
26 | struct gpio_desc; | 26 | #include "gpiolib.h" |
27 | 27 | ||
28 | /* Private data structure for of_gpiochip_find_and_xlate */ | 28 | /* Private data structure for of_gpiochip_find_and_xlate */ |
29 | struct gg_data { | 29 | struct gg_data { |
@@ -82,19 +82,19 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, | |||
82 | ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index, | 82 | ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index, |
83 | &gg_data.gpiospec); | 83 | &gg_data.gpiospec); |
84 | if (ret) { | 84 | if (ret) { |
85 | pr_debug("%s: can't parse gpios property of node '%s[%d]'\n", | 85 | pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n", |
86 | __func__, np->full_name, index); | 86 | __func__, propname, np->full_name, index); |
87 | return ERR_PTR(ret); | 87 | return ERR_PTR(ret); |
88 | } | 88 | } |
89 | 89 | ||
90 | gpiochip_find(&gg_data, of_gpiochip_find_and_xlate); | 90 | gpiochip_find(&gg_data, of_gpiochip_find_and_xlate); |
91 | 91 | ||
92 | of_node_put(gg_data.gpiospec.np); | 92 | of_node_put(gg_data.gpiospec.np); |
93 | pr_debug("%s exited with status %d\n", __func__, | 93 | pr_debug("%s: parsed '%s' property of node '%s[%d]' - status (%d)\n", |
94 | __func__, propname, np->full_name, index, | ||
94 | PTR_ERR_OR_ZERO(gg_data.out_gpio)); | 95 | PTR_ERR_OR_ZERO(gg_data.out_gpio)); |
95 | return gg_data.out_gpio; | 96 | return gg_data.out_gpio; |
96 | } | 97 | } |
97 | EXPORT_SYMBOL(of_get_named_gpiod_flags); | ||
98 | 98 | ||
99 | int of_get_named_gpio_flags(struct device_node *np, const char *list_name, | 99 | int of_get_named_gpio_flags(struct device_node *np, const char *list_name, |
100 | int index, enum of_gpio_flags *flags) | 100 | int index, enum of_gpio_flags *flags) |
@@ -307,7 +307,5 @@ void of_gpiochip_add(struct gpio_chip *chip) | |||
307 | void of_gpiochip_remove(struct gpio_chip *chip) | 307 | void of_gpiochip_remove(struct gpio_chip *chip) |
308 | { | 308 | { |
309 | gpiochip_remove_pin_ranges(chip); | 309 | gpiochip_remove_pin_ranges(chip); |
310 | 310 | of_node_put(chip->of_node); | |
311 | if (chip->of_node) | ||
312 | of_node_put(chip->of_node); | ||
313 | } | 311 | } |