aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2020-12-16 16:26:34 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2021-02-14 18:29:22 +0100
commitf0b58be61cf0f21d346213963ad3405ab57c53e3 (patch)
tree10f35aa04273d7dfbec9c39b24877b52d2564337
parent3a9d70a32ea5bbc2c13370cc5cf253fce4c51d20 (diff)
downloadbackports-f0b58be61cf0f21d346213963ad3405ab57c53e3.tar.gz
backport: declare GPIO own_desc functions if GPIOLIB is not defined
In kernels older than v5.4, the gpiochip_request_own_desc() and the gpiochip_free_own_desc() functions are declared inside a CONFIG_GPIOLIB ifdef, so we need to declare them in our implementation to avoid compilation problems. Change-Id: Ic6da0d7ff9d99c64d110da63fb950fb555fd2782 Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--backport/compat/backport-5.3.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/backport/compat/backport-5.3.c b/backport/compat/backport-5.3.c
index f501448e..46e6a11d 100644
--- a/backport/compat/backport-5.3.c
+++ b/backport/compat/backport-5.3.c
@@ -45,6 +45,17 @@ static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
}
#undef gpiochip_request_own_desc
+
+/* In kernels older than 5.4, these function declarations are inside a
+ * CONFIG_GPIOLIB ifdef, so we need to declare them here.
+ */
+#ifndef CONFIG_GPIOLIB
+extern struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip,
+ u16 hwnum,
+ const char *label);
+void gpiochip_free_own_desc(struct gpio_desc *desc);
+#endif /* CONFIG_GPIOLIB */
+
struct gpio_desc *backport_gpiochip_request_own_desc(struct gpio_chip *gc,
unsigned int hwnum,
const char *label,