aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch
diff options
context:
space:
mode:
authorAndré Draszik <git@andred.net>2018-02-22 11:04:28 +0000
committerJohn Crispin <john@phrozen.org>2018-03-13 08:34:58 +0100
commitcff2dedebc665dc1d3d64d850afd0124c6d35eaa (patch)
treeeb5eecbb90f31a28b855b7b3b42f0cc5c0c3746a /target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch
parent4fd87220567f1ae3ad209da1f602dc81c6b4d6b1 (diff)
downloadupstream-cff2dedebc665dc1d3d64d850afd0124c6d35eaa.tar.gz
upstream-cff2dedebc665dc1d3d64d850afd0124c6d35eaa.tar.bz2
upstream-cff2dedebc665dc1d3d64d850afd0124c6d35eaa.zip
ramips: gpio: fix compilation if CONFIG_GPIO_SYSFS=n
If CONFIG_GPIO_SYSFS=n, compilation fails with drivers/built-in.o: In function `gpio_export_with_name': include/asm-generic/gpio.h:128: undefined reference to `__gpiod_export' This is because the stub in that case has the wrong name, _gpiod_export() - note the missing underscore (_) at the start. Fix the stub, and add the correct prototype for the real implementation. Signed-off-by: André Draszik <git@andred.net>
Diffstat (limited to 'target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch')
-rw-r--r--target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch15
1 files changed, 3 insertions, 12 deletions
diff --git a/target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch b/target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch
index 3434864d26..136c102758 100644
--- a/target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch
+++ b/target/linux/ramips/patches-4.9/0024-GPIO-add-named-gpio-exports.patch
@@ -127,11 +127,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
static int match_export(struct device *dev, const void *desc)
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
-@@ -126,6 +126,12 @@ static inline int gpio_export(unsigned g
+@@ -126,6 +126,11 @@ static inline int gpio_export(unsigned g
return gpiod_export(gpio_to_desc(gpio), direction_may_change);
}
-+int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name);
+static inline int gpio_export_with_name(unsigned gpio, bool direction_may_change, const char *name)
+{
+ return __gpiod_export(gpio_to_desc(gpio), direction_may_change, name);
@@ -142,21 +141,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
{
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
-@@ -427,6 +427,7 @@ static inline struct gpio_desc *devm_get
-
- #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
-
-+int _gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name);
- int gpiod_export(struct gpio_desc *desc, bool direction_may_change);
- int gpiod_export_link(struct device *dev, const char *name,
- struct gpio_desc *desc);
@@ -434,6 +435,13 @@ void gpiod_unexport(struct gpio_desc *de
#else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */
+static inline int _gpiod_export(struct gpio_desc *desc,
-+ bool direction_may_change,
-+ const char *name)
++ bool direction_may_change,
++ const char *name)
+{
+ return -ENOSYS;
+}