Subject: [PATCH v3] gpiolib: Add stubs for gpiod lookup table interface
Add stubs for gpiod_add_lookup_table() and gpiod_remove_lookup_table() for the !GPIOLIB case to prevent build errors. Also add prototypes.
---
Changes in v3:
- add stubs for !GPIOLIB case. Drop prototypes, these are already in gpio/machine.h
Changes in v2:
- move gpiod_lookup_table out of #ifdef
include/linux/gpio/consumer.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/linux/gpio/consumer.h +8 -0
@@ -41,6 +41,8 @@ enum gpiod_flags { GPIOD_FLAGS_BIT_DIR_VAL, }; +struct gpiod_lookup_table ; +#ifdef CONFIG_GPIOLIB /* Return the number of GPIOs associated with a device / function */
@@ -435,6 +437,12 @@ struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,return ERR_PTR (-ENOSYS ); } +static inline +void gpiod_add_lookup_table (struct gpiod_lookup_table *table) {} + +static inline +void gpiod_remove_lookup_table (struct gpiod_lookup_table *table) {} +#endif /* CONFIG_GPIOLIB */ static inline
Signature · 1 line
2.7.4
Quoted 10 lines · Anatolij Gustschin
Subject: [PATCH v3] gpiolib: Add stubs for gpiod lookup table interface
Add stubs for
gpiod_add_lookup_table()andgpiod_remove_lookup_table()for the !GPIOLIB case to prevent build errors. Also add prototypes.Signed-off-by Anatolij Gustschin <[email protected]>---
Changes in v3:
- add stubs for !GPIOLIB case. Drop prototypes, these are already ingpio/machine.h
Yeah...
include/linux/gpio/consumer.h
Quoted 2 lines
include/linux/gpio/consumer.h +0
-0
So why should the stubs be in <linux/gpio/consumer.h> and not in <linux/gpio/machine.h>?
Yours,
Linus Walleij
On Fri, 28 Apr 2017 10:43:19 +0200
Linus Walleij [email protected] wrote:
...
Quoted 5 lines
include/linux/gpio/consumer.h
Quoted 2 lines
include/linux/gpio/consumer.h +0
-0So why should the stubs be in <
linux/gpio/consumer.h> and not in <linux/gpio/machine.h>?
good question. I'll move them to machine.h.
Thanks,
Anatolij