aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2014-05-17 01:54:50 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-05-21 05:14:46 -0400
commitf01d907582f8461546379aa415a7c6d5cfb8e5fd (patch)
treeb1e0520a32e14d14650f2eea7ad07dd149f81444 /drivers/gpio
parent1aeede0b3c055665fb722a012d3cd834146fc112 (diff)
gpio: make of_get_named_gpiod_flags() private
of_get_named_gpiod_flags() is visible and directly usable by GPIO consumers, but it really should not as the gpiod interface relies on the simpler gpiod_get() to provide properly-configured GPIOs. of_get_named_gpiod_flags() is just used internally by gpiolib to implement gpiod_get(), and by the old of_get_named_gpio_flags() function, therefore it makes sense to make it gpiolib-private. As a side-effect, the unused (and unneeded) of_get_gpiod_flags() inline function is also removed, and of_get_named_gpio_flags() is moved from a static inline function to a regular one in gpiolib-of.c This results in all references to gpiod_* functions in of_gpio.h being gone, which is the way it should be since this file is part of the old integer GPIO interface. Changes since v1: - Fixed compilation error when CONFIG_OF_GPIO is not defined - Fixed warning due to of_gpio_flags enum not being declared in private gpiolib.h header Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-of.c14
-rw-r--r--drivers/gpio/gpiolib.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index db98d3a12f70..af7e25c9a9ae 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -96,6 +96,20 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
96} 96}
97EXPORT_SYMBOL(of_get_named_gpiod_flags); 97EXPORT_SYMBOL(of_get_named_gpiod_flags);
98 98
99int of_get_named_gpio_flags(struct device_node *np, const char *list_name,
100 int index, enum of_gpio_flags *flags)
101{
102 struct gpio_desc *desc;
103
104 desc = of_get_named_gpiod_flags(np, list_name, index, flags);
105
106 if (IS_ERR(desc))
107 return PTR_ERR(desc);
108 else
109 return desc_to_gpio(desc);
110}
111EXPORT_SYMBOL(of_get_named_gpio_flags);
112
99/** 113/**
100 * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags 114 * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags
101 * @gc: pointer to the gpio_chip structure 115 * @gc: pointer to the gpio_chip structure
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index cf092941a9fd..1a4103dd38df 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -15,6 +15,8 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/device.h> 16#include <linux/device.h>
17 17
18enum of_gpio_flags;
19
18/** 20/**
19 * struct acpi_gpio_info - ACPI GPIO specific information 21 * struct acpi_gpio_info - ACPI GPIO specific information
20 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo 22 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
@@ -46,4 +48,7 @@ acpi_get_gpiod_by_index(struct device *dev, int index,
46int gpiochip_request_own_desc(struct gpio_desc *desc, const char *label); 48int gpiochip_request_own_desc(struct gpio_desc *desc, const char *label);
47void gpiochip_free_own_desc(struct gpio_desc *desc); 49void gpiochip_free_own_desc(struct gpio_desc *desc);
48 50
51struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
52 const char *list_name, int index, enum of_gpio_flags *flags);
53
49#endif /* GPIOLIB_H */ 54#endif /* GPIOLIB_H */