summaryrefslogtreecommitdiff
path: root/include/linux/gpio.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-02-07 16:29:45 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-03-06 12:33:01 +0200
commitd74e316633e49f44756c23997fa071979a939405 (patch)
treee0e465bb5ad25bfeee3dff9a51ef3d6e63735e0e /include/linux/gpio.h
parent0e685c3e7158d35626d6d76b9f859eae806d87fa (diff)
gpiolib: remove legacy gpio_export()
There are only a handful of users of gpio_export() and related functions. As these are just wrappers around the modern gpiod_export() helper, remove the wrappers and open-code the gpio_to_desc in all callers to shrink the legacy API. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r--include/linux/gpio.h27
1 files changed, 0 insertions, 27 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index fc56733e8514..a86953696e47 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -132,20 +132,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
int gpio_request_array(const struct gpio *array, size_t num);
void gpio_free_array(const struct gpio *array, size_t num);
-/*
- * A sysfs interface can be exported by individual drivers if they want,
- * but more typically is configured entirely from userspace.
- */
-static inline int gpio_export(unsigned gpio, bool direction_may_change)
-{
- return gpiod_export(gpio_to_desc(gpio), direction_may_change);
-}
-
-static inline void gpio_unexport(unsigned gpio)
-{
- gpiod_unexport(gpio_to_desc(gpio));
-}
-
/* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */
struct device;
@@ -242,19 +228,6 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value)
WARN_ON(1);
}
-static inline int gpio_export(unsigned gpio, bool direction_may_change)
-{
- /* GPIO can never have been requested or set as {in,out}put */
- WARN_ON(1);
- return -EINVAL;
-}
-
-static inline void gpio_unexport(unsigned gpio)
-{
- /* GPIO can never have been exported */
- WARN_ON(1);
-}
-
static inline int gpio_to_irq(unsigned gpio)
{
/* GPIO can never have been requested or set as input */